1
0
mirror of https://github.com/elk-zone/elk synced 2024-11-23 22:56:09 +09:00
elk/pages/notifications.vue
2022-11-24 14:42:26 +08:00

30 lines
728 B
Vue

<script setup lang="ts">
import { STORAGE_KEY_NOTIFY_TAB } from '~/constants'
definePageMeta({
middleware: 'auth',
})
const tabNames = ['All', 'Mentions'] as const
const tab = $(useLocalStorage<typeof tabNames[number]>(STORAGE_KEY_NOTIFY_TAB, 'All'))
const paginator = $computed(() => {
return masto.notifications.getIterator(tab === 'All' ? undefined : { types: ['mention'] })
})
</script>
<template>
<MainContent>
<template #title>
<span text-lg font-bold>Notifications</span>
</template>
<template #header>
<CommonTabs v-model="tab" :options="tabNames" />
</template>
<slot>
<NotificationPaginator :key="tab" :paginator="paginator" />
</slot>
</MainContent>
</template>