// Shared notification-drawer state. The bell in the topbar opens the drawer // via `open()`; the drawer reads from `items` and toggles `unread` via // `markRead` / `markAllRead`. `unreadCount` powers the red dot on the bell. // // All state is in-memory and re-seeds from the NOTIFICATIONS fixture on each // full reload — there's no backend yet. When the real notifications source // lands (see follow-ups in NEXT-STEPS.md), swap `items` for a useFetch. import { NOTIFICATIONS, type NotificationItem } from '~/data/fixtures' const isOpen = ref(false) const items = ref(NOTIFICATIONS.map((n) => ({ ...n }))) const unreadCount = computed(() => items.value.filter((n) => n.unread).length) export const useNotifications = () => ({ isOpen, items, unreadCount, open: () => { isOpen.value = true }, close: () => { isOpen.value = false }, markRead: (id: string) => { const i = items.value.find((n) => n.id === id) if (i) i.unread = false }, markAllRead: () => { for (const n of items.value) n.unread = false }, })