/** * @file ToastNotice.tsx * @description The config explorers' `{kind, message}` toast shape and * `showToast`, which hands it to the app-wide toast queue (`lib/toast.ts`): a * success fades on its own, an error stays until dismissed. The panels keep * taking an `onToast(Toast)` prop, so this is the one place it is rendered. * @author Nguyễn Ngọc Trí Vĩ */ import { toast } from "../../lib/toast"; export type Toast = { kind: "success" | "error"; message: string } | null; /** Show a config-page toast through the global queue. */ export function showToast(t: NonNullable): void { if (t.kind === "error") toast.error(t.message); else toast.success(t.message); }