import type { ReactNode } from "react"; import { Check, Loader2, XCircle } from "lucide-react"; import { cn } from "@/lib/cn"; type Variant = "loading" | "success" | "error"; type Props = { variant: Variant; title: ReactNode; description?: ReactNode; children?: ReactNode; actions?: ReactNode; }; const VARIANTS: Record = { loading: { icon: , className: "bg-nb-gray-100", }, success: { icon: , className: "bg-green-500", }, error: { icon: , className: "bg-red-500", }, }; export function StatusPanel({ variant, title, description, children, actions }: Props) { const { icon, className } = VARIANTS[variant]; return (
{icon}

{title}

{description &&

{description}

}
{children &&
{children}
} {actions &&
{actions}
}
); }