// Copyright (c) 2025-2026, RTE (https://www.rte-france.com) // This Source Code Form is subject to the terms of the Mozilla Public License, version 2.0. // If a copy of the Mozilla Public License, version 2.0 was not distributed with this file, // you can obtain one at http://mozilla.org/MPL/2.0/. // SPDX-License-Identifier: MPL-2.0 import { colors, radius, space } from '../styles/tokens'; import { useNotifications, dismissNotification, type Notification, type NotificationSeverity, } from '../utils/notifications'; /** * Renders the typed notification store (D5) as a stack of dismissible * toasts pinned bottom-right. Replaces the former `StatusToasts` dual * error/info banners: severity is explicit (no `'SUCCESS'` string * protocol), every toast has a dismiss control, and the stack lives in an * `aria-live` region so assistive tech announces new toasts (errors * assertively via `role="alert"`, info/success politely). */ const SEVERITY_BG: Record = { error: colors.danger, success: colors.success, info: colors.brand, }; function Toast({ item }: { item: Notification }) { return (
{item.message}
); } export default function NotificationHost() { const items = useNotifications(); if (items.length === 0) return null; return (
{items.map(item => )}
); }