fix: sync notification and shop dashboard state
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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 })),
|
||||
})),
|
||||
}))
|
||||
Reference in New Issue
Block a user