1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-20 07:49:57 +00:00
elk/components/conversation/ConversationPaginator.vue

25 lines
722 B
Vue
Raw Normal View History

2022-11-18 09:37:22 +00:00
<script setup lang="ts">
2023-01-08 06:21:09 +00:00
import type { Paginator, mastodon } from 'masto'
2022-11-18 09:37:22 +00:00
const { paginator } = defineProps<{
2023-01-08 06:21:09 +00:00
paginator: Paginator<mastodon.v1.Conversation[], mastodon.DefaultPaginationParams>
2022-11-18 09:37:22 +00:00
}>()
function preprocess(items: mastodon.v1.Conversation[]): mastodon.v1.Conversation[] {
return items.filter(items => !items.lastStatus?.filtered?.find(
filter => filter.filter.filterAction === 'hide' && filter.filter.context.includes('thread'),
))
}
2022-11-18 09:37:22 +00:00
</script>
<template>
<CommonPaginator :paginator="paginator" :preprocess="preprocess">
2022-11-18 09:37:22 +00:00
<template #default="{ item }">
<ConversationCard
:conversation="item"
2022-11-23 02:16:31 +00:00
border="b base" py-1
2022-11-18 09:37:22 +00:00
/>
</template>
</CommonPaginator>
</template>