Files
juwan-frontend/store/notifications.ts
T
2026-02-22 06:43:24 +08:00

17 lines
489 B
TypeScript

import { create } from "zustand"
import { mockNotifications } from "@/lib/mock"
import type { Notification } from "@/lib/types"
interface NotificationState {
notifications: Notification[]
markAllAsRead: () => void
}
export const useNotificationStore = create<NotificationState>((set) => ({
notifications: mockNotifications,
markAllAsRead: () =>
set((state) => ({
notifications: state.notifications.map((notification) => ({ ...notification, read: true })),
})),
}))