import { TriangleAlertIcon } from "lucide-react"; import type { HubState } from "@/lib/db/schema"; import { cn } from "@/lib/utils"; export const HUB_STATE_LABEL: Record, { label: string; title: string }> = { repo_missing: { label: "deleted on Hub", title: "The repo is no longer on Hugging Face (deleted, or made private). Your local files are kept.", }, commit_missing: { label: "commit deleted on Hub", title: "The pinned commit is no longer on Hugging Face (history rewritten). Your local files are kept.", }, }; /** Warning badge when a model's repo or pinned commit disappeared from the Hub; nothing otherwise. */ export function HubStateBadge({ state, className }: { state: HubState | null; className?: string }) { if (!state || state === "available") return null; const { label, title } = HUB_STATE_LABEL[state]; return ( {label} ); }