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