import type { ReactNode } from "react"; import type { LucideIcon } from "lucide-react"; import { X } from "lucide-react"; type BannerTone = "accent" | "warning"; const TONES: Record = { accent: { bar: "bg-accent/15 border-accent/30", icon: "text-accent", action: "bg-accent text-accent-fg" }, warning: { bar: "bg-amber-500/15 border-amber-500/30", icon: "text-amber-500", action: "bg-amber-500 text-black" }, }; // Shared top-of-app notification bar. VersionBanner and DemoBanner are thin wrappers over this; // a future news-ticker variant can build on the same shell (rotating content as children). export default function Banner({ tone, icon: Icon, children, action, onDismiss, dismissTitle, }: { tone: BannerTone; icon: LucideIcon; children: ReactNode; action?: { label: string; onClick: () => void }; onDismiss?: () => void; dismissTitle?: string; }) { const c = TONES[tone]; return (
{children} {action && ( )} {onDismiss && ( )}
); }