import { AlertTriangle, Inbox } from "lucide-react";
import type { ReactNode } from "react";
import { cn } from "./cn";
export function EmptyState({ title = "Nothing here yet", description, action, icon, className, compact }: { title?: ReactNode; description?: ReactNode; action?: ReactNode; icon?: ReactNode; className?: string; compact?: boolean }) {
return (
{icon ?? }
{title}
{description &&
{description}
}
{action &&
{action}
}
);
}
export function ErrorState({ title = "Data temporarily unavailable", description = "The index API did not respond. The page will recover automatically once it is reachable.", action, className, compact, detail }: { title?: ReactNode; description?: ReactNode; action?: ReactNode; className?: string; compact?: boolean; detail?: string }) {
return (
{title}
{description &&
{description}
}
{detail &&
{detail}}
{action &&
{action}
}
);
}
/** Inline offline notice shown at the top of a page when the API is down but we still render the shell. */
export function OfflineNotice({ detail, className }: { detail?: string; className?: string }) {
return (
Live data is temporarily unavailable — showing the page structure without figures.
{detail && ({detail})}
);
}