1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-14 12:59:59 +00:00
elk/pages/notifications.vue

36 lines
836 B
Vue
Raw Normal View History

2022-11-15 21:21:54 +00:00
<script setup lang="ts">
2022-11-23 13:06:27 +00:00
import { STORAGE_KEY_NOTIFY_TAB } from '~/constants'
2022-11-15 21:21:54 +00:00
definePageMeta({
middleware: 'auth',
})
2022-11-28 14:25:32 +00:00
const { t } = useI18n()
const tabNames = ['All', 'Mentions'] as const
2022-11-23 13:06:27 +00:00
const tab = $(useLocalStorage<typeof tabNames[number]>(STORAGE_KEY_NOTIFY_TAB, 'All'))
2022-11-19 15:15:19 +00:00
const paginator = $computed(() => {
return useMasto().notifications.getIterator(tab === 'All' ? undefined : { types: ['mention'] })
2022-11-19 15:15:19 +00:00
})
2022-11-25 11:48:48 +00:00
useHead({
2022-11-28 14:25:32 +00:00
title: () => t('nav_side.notifications'),
2022-11-25 11:48:48 +00:00
})
2022-11-15 21:21:54 +00:00
</script>
<template>
<MainContent>
<template #title>
2022-11-28 14:25:32 +00:00
<span text-lg font-bold>{{ t('nav_side.notifications') }}</span>
2022-11-15 21:21:54 +00:00
</template>
2022-11-24 06:42:26 +00:00
2022-11-23 08:08:49 +00:00
<template #header>
<CommonTabs v-model="tab" :options="tabNames" />
2022-11-23 08:08:49 +00:00
</template>
<slot>
2022-11-19 15:15:19 +00:00
<NotificationPaginator :key="tab" :paginator="paginator" />
2022-11-15 21:21:54 +00:00
</slot>
</MainContent>
</template>