import { Article, Broadcast, Paperclip, PlayCircle } from "@phosphor-icons/react/dist/ssr";

import { relogio, type TipoDeAula } from "@/lib/digitais/curso";

/* O ícone e o rótulo de cada tipo de aula (lista do curso e sala de aula). */

export function IconeDaAula({ tipo, className, style }: { tipo: TipoDeAula; className?: string; style?: React.CSSProperties }) {
  if (tipo === "texto") return <Article weight="fill" className={className} style={style} />;
  if (tipo === "materiais") return <Paperclip weight="bold" className={className} style={style} />;
  if (tipo === "ao_vivo") return <Broadcast weight="fill" className={className} style={style} />;
  return <PlayCircle weight="fill" className={className} style={style} />;
}

export function rotuloDoTipo(tipo: TipoDeAula, duracaoS: number | null): string {
  if (tipo === "texto") return "Leitura";
  if (tipo === "materiais") return "Materiais";
  if (tipo === "ao_vivo") return "Ao vivo";
  return duracaoS ? relogio(duracaoS) : "Vídeo";
}
