import { useEffect } from "react"; import type { NoticeOptions } from "./navigation-notice"; /** Shares the creation status surface so every transient shell message looks the same. */ export default function NavigationNotice( { notice, show }: { notice: NoticeOptions; show: (options?: NoticeOptions) => void }, ) { useEffect(() => { let timer = setTimeout(show, notice.duration ?? 2000); return () => clearTimeout(timer); }, [notice, show]); return (
{notice.message} {notice.action && ( )}
); }