implement notification page (#8)

This commit is contained in:
UUBulb
2024-11-20 21:37:03 +08:00
committed by GitHub
parent e37f30d335
commit b3588b3378
27 changed files with 1133 additions and 36 deletions

View File

@@ -0,0 +1,18 @@
import { NotificationStore } from '@/types'
import { create } from 'zustand'
import { persist, createJSONStorage } from 'zustand/middleware'
export const useNotificationStore = create<NotificationStore, [['zustand/persist', NotificationStore]]>(
persist(
(set, get) => ({
notifiers: get()?.notifiers,
notifierGroup: get()?.notifierGroup,
setNotifier: notifiers => set({ notifiers }),
setNotifierGroup: notifierGroup => set({ notifierGroup }),
}),
{
name: 'notificationStore',
storage: createJSONStorage(() => localStorage),
},
),
)