import type { DocumentType } from "@/types/knowledge";

const labels: Record<DocumentType, string> = {
  manual: "Bedienungsanleitung",
  service_manual: "Service Manual",
  schematic: "Schaltplan",
  alignment: "Abgleich",
  parts_list: "Ersatzteile",
  firmware: "Firmware",
  datasheet: "Datenblatt",
  service_bulletin: "Bulletin",
  other: "Sonstiges",
};

export function documentTypeLabel(type: DocumentType) {
  return labels[type] ?? type;
}

export default function DocumentTypeBadge({ type }: { type: DocumentType }) {
  return (
    <span className="rounded-full bg-slate-100 px-2 py-1 text-xs font-semibold text-slate-700">
      {documentTypeLabel(type)}
    </span>
  );
}
