import { Badge } from "@/components/ui/Badge";
import type { CapabilitiesView } from "@/lib/api/types";

// 探活结果的能力徽章：结构化输出 / 前缀缓存 / 思考，各显示开关态。
export function CapabilityBadges({ caps }: { caps: CapabilitiesView }) {
  const badges: { on: boolean; label: string }[] = [
    { on: caps.structured_output, label: "结构化" },
    { on: caps.prefix_cache, label: "前缀缓存" },
    { on: caps.thinking, label: "思考" },
  ];
  return (
    <div className="flex gap-1.5">
      {badges.map((b) => (
        <Badge
          key={b.label}
          variant={b.on ? "accent" : "neutral"}
          className="text-2xs"
        >
          {b.label}
        </Badge>
      ))}
    </div>
  );
}
