fix: sync notification and shop dashboard state

This commit is contained in:
zetaloop
2026-02-22 06:43:24 +08:00
parent 02269dd9c3
commit 5f25043923
6 changed files with 152 additions and 74 deletions
+16
View File
@@ -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 })),
})),
}))