Scrum4Me/components/notifications/notifications-realtime-mount.tsx
Scrum4Me Agent 924a31b89a feat(PBI-49): add BEM sub-element data-debug-id to components/notifications/*
- answer-modal: __content (scroll area), __submit (footer)
- notifications-bridge: skip comment (bridge, non-rendering wrapper)
- notifications-realtime-mount: skip comment (returns null)
- notifications-sheet: __header, __items (questions list)
- push-toggle: __switch (button), __label (button text) on subscribed/unsubscribed states
2026-05-09 22:27:23 +02:00

24 lines
852 B
TypeScript

// ST-1105: Tiny client island dat de notifications-store hydrateert met
// server-side fetched initial questions en de SSE-realtime hook activeert.
'use client'
import { useEffect } from 'react'
import { useNotificationsStore, type NotificationQuestion } from '@/stores/notifications-store'
import { useNotificationsRealtime } from '@/lib/realtime/use-notifications-realtime'
interface Props {
initial: NotificationQuestion[]
}
export function NotificationsRealtimeMount({ initial }: Props) {
// Hydrate de store met server-side-rendered data zodat de bell-count direct
// klopt zonder te wachten op de SSE state-event.
useEffect(() => {
useNotificationsStore.getState().init(initial)
}, [initial])
useNotificationsRealtime()
// debug-id: skip — render-loos mount (returns null, zie docs/patterns/debug-id.md)
return null
}