-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSubscriptionsList.vue
More file actions
60 lines (55 loc) · 1.75 KB
/
SubscriptionsList.vue
File metadata and controls
60 lines (55 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<template>
<div>
<v-row>
<template v-if="feeds.length">
<v-col v-for="feed in feeds" :key="feed.id" cols="12" sm="6" md="4" lg="3">
<FeedCard :feed="feed" />
</v-col>
</template>
<template v-else>
<v-spacer></v-spacer>
<v-col cols="10" justify="center">
<v-card>
<v-card-title :class="xs ? 'text-h6 text-center' : 'text-h5'">אין פידים מתאימים להצגה</v-card-title>
<v-card-text>
ניתן להוסיף פידים חדשים באמצעות לחיצה על הכפתור "הוסף מקור חדש" בצד שמאל
</v-card-text>
</v-card>
</v-col>
<v-spacer></v-spacer>
</template>
</v-row>
</div>
</template>
<script setup>
import { useFeedsStore } from '@/stores/feeds'
import { computed, toRefs } from 'vue'
import { useDisplay } from 'vuetify'
import FeedCard from '@/components/FeedCard.vue'
const feedStore = useFeedsStore()
const { xs } = useDisplay()
const props = defineProps({
search: {
type: String,
default: ''
},
showOnlySubs: {
type: Boolean,
required: true
}
})
const { search, showOnlySubs } = toRefs(props)
await feedStore.fetchFeeds()
const feeds = computed(() => {
let feeds = feedStore.feeds
if (showOnlySubs.value) {
feeds = feeds.filter(feed => feed.subscribed)
}
if (!search.value.length) {
return feeds
}
return feeds.filter(feed => {
return feed.title.toLowerCase().includes(search.value.toLowerCase())
})
})
</script>