import { Badge } from "../../../shared/ui/badge";
import type { WsStatus } from "../model/types";

const toneByStatus: Record<WsStatus, string> = {
  connecting: "bg-slate-600",
  open: "bg-emerald-600",
  reconnecting: "bg-amber-600",
  disconnected: "bg-rose-600",
};

export function WsStatusBadge({ status }: { status: WsStatus }) {
  return (
    <Badge className={`${toneByStatus[status]} text-white`}>ws: {status}</Badge>
  );
}
