Berichten: status boven bericht, ongelezen-bolletje, 'markeer als ongelezen' en dashboardtegel met aantal ongelezen (CMS-U12)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-11 13:37:18 +01:00
co-authored by Claude Sonnet 5.5
parent 705f6e34d7
commit daccc6a227
10 changed files with 210 additions and 9 deletions
@@ -22,6 +22,16 @@ export function useContactMessages(filter: ContactFilter, page: number) {
});
}
/** Only the unread counter, for the dashboard tile (one item is enough: the counter is part of every list answer). */
export function useUnreadContactCount(enabled: boolean) {
return useQuery<number, Error>({
queryKey: ['contact', 'messages', 'unreadCount'],
enabled,
queryFn: async () =>
(await api.get<ContactMessageList>(`${BASE}?page=1&pageSize=1`)).unreadCount,
});
}
export function useContactMessage(id: string | null) {
return useQuery<ContactMessageDetail, Error>({
queryKey: ['contact', 'message', id],