) => {
if (
event.button !== 0 ||
event.metaKey ||
event.ctrlKey ||
event.shiftKey ||
event.altKey
)
return;
event.preventDefault();
focusDetail.current = true;
setSelectedId(notification.id);
setOpen(false);
},
},
}
: undefined,
}))}
filters={FILTERS}
filterValue={filter}
onFilterChange={setFilter}
onReadChange={(notification, read) =>
setNotifications((current) =>
current.map((candidate) =>
candidate.id === notification.id
? { ...candidate, read }
: candidate,
),
)
}
onMarkAllRead={(ids) => {
const selectedIds = new Set(ids);
setNotifications((current) =>
current.map((notification) =>
selectedIds.has(notification.id)
? { ...notification, read: true }
: notification,
),
);
}}
sheetProps={{
theme,
onCloseAutoFocus: (event) => {
if (!focusDetail.current) return;
event.preventDefault();
focusDetail.current = false;
detailRef.current?.focus({ preventScroll: true });
},
}}
/>
{selected ? (
<>
{selected.typeLabel}
{selected.title}
{selected.description}
>
) : (
Open a notification to inspect its local sample detail.
)}
Local sample records. Changes are not stored or sent.