import { chatStatusMeta, type ChatStatusKey, type ChatStatusTone } from "@/mocks/dshnChatThreads";
import { cn } from "./ui";

const TONE: Record<ChatStatusTone, string> = {
  gray: "bg-background-200 text-foreground-700",
  yellow: "bg-secondary-100 text-secondary-900",
  mint: "bg-accent-100 text-accent-800",
  green: "bg-accent-500 text-background-50",
  red: "bg-danger-100 text-danger-700",
};

export default function ChatStatusBadge({
  status,
  className = "",
}: {
  status: ChatStatusKey;
  className?: string;
}) {
  const meta = chatStatusMeta[status];
  return (
    <span
      className={cn(
        "inline-flex items-center rounded-full px-2.5 py-1 text-[10.5px] font-semibold whitespace-nowrap",
        TONE[meta.tone],
        className,
      )}
    >
      {meta.label}
    </span>
  );
}