/* O selo colorido do tipo do arquivo (PDF, ZIP, MP4...), igual na lista,
   no produto e na loja. */

export const COR_DA_CATEGORIA: Record<string, string> = {
  video: "#6D28D9",
  pdf: "#E5484D",
  imagem: "#2F80ED",
  compactado: "#F2994A",
  audio: "#0E9E70",
  documento: "#4F5B76",
  outro: "#7C7C94",
  link: "#7B61FF",
  texto: "#4F5B76",
};

export const ROTULO_DA_CATEGORIA: Record<string, string> = {
  video: "Vídeos",
  pdf: "PDFs",
  imagem: "Imagens",
  compactado: "ZIP",
  audio: "Áudios",
  documento: "Documentos",
  outro: "Outros",
};

export function SeloDoArquivo({ categoria, texto, tamanho = 40 }: { categoria: string; texto: string; tamanho?: number }) {
  return (
    <span
      className="flex shrink-0 items-center justify-center rounded-xl font-extrabold uppercase tracking-wide text-white"
      style={{
        width: tamanho,
        height: tamanho,
        fontSize: Math.max(9, Math.round(tamanho / 4.2)),
        background: COR_DA_CATEGORIA[categoria] ?? COR_DA_CATEGORIA.outro,
      }}
      aria-hidden
    >
      {texto.slice(0, 4)}
    </span>
  );
}
