export default function RiskBadge({ level }: { level: string }) {
  const styles: Record<string, string> = {
    low: "border-emerald-200 bg-emerald-50 text-emerald-700",
    medium: "border-amber-200 bg-amber-50 text-amber-700",
    high: "border-orange-200 bg-orange-50 text-orange-700",
    forbidden: "border-rose-200 bg-rose-50 text-rose-700"
  };
  const labels: Record<string, string> = {
    low: "低风险",
    medium: "中风险",
    high: "高风险",
    forbidden: "禁止"
  };
  return (
    <span className={`inline-flex rounded-md border px-2 py-1 text-xs font-medium ${styles[level] ?? styles.medium}`}>
      {labels[level] ?? level}
    </span>
  );
}

