// AK-P3 Interim-UI (AD-28) — topbar notifications drawer composed from ~/ui
// (real Drawer, not a card fake — D07). Pure presentational: the host (NavBar)
// owns the SSE subscription and open state; items arrive as VM props, clicks
// follow validated deeplinks. Final Subframe optics land as a tracked
// design-nachzug once David's D-P3 ships.
import { useTranslation } from "react-i18next";
import type { NotificationCenterItemVM } from "@hivegrid/view-models";
import { BadgeFeedback } from "~/ui/components/BadgeFeedback";
import { Button } from "~/ui/components/Button";
import { Drawer } from "~/ui/components/Drawer";
import { EmptyState } from "~/ui/components/EmptyState";
import { APP_TIME_ZONE } from "~/locale/format";
import { AppLink } from "~/components/app/AppLink";
const DRAWER_MAX_ITEMS = 10;
export type NotificationsDrawerProps = {
open: boolean;
items: readonly NotificationCenterItemVM[];
/** Href of the full notification center route ("show all"). */
allHref: string;
onClose: () => void;
};
export function NotificationsDrawer({ open, items, allHref, onClose }: NotificationsDrawerProps) {
const { t, i18n } = useTranslation();
const visibleItems = items.slice(0, DRAWER_MAX_ITEMS);
const dateTimeFormatter = new Intl.DateTimeFormat(i18n.language, { timeZone: APP_TIME_ZONE, dateStyle: "short", timeStyle: "short" });
return (
{visibleItems.map((item) => (
)}