import Link from "next/link"; import { ArrowLeft, BookOpenCheck, Clock3, GraduationCap, UsersRound } from "lucide-react"; import { cn } from "@/lib/utils"; type CourseDetailHeaderProps = { title: string; stageLabel: string; proficiencyLabel: string; availabilityLabel: string; availabilityState: "published" | "upcoming" | "draft"; description: string; thumbnailUrl: string | null; instructor: string; durationLabel: string; lessonCount: number; studentsCount: number; }; const availabilityClass: Record = { published: "border-emerald-300/70 bg-emerald-50 text-emerald-800 dark:border-emerald-700/40 dark:bg-emerald-900/30 dark:text-emerald-200", upcoming: "border-amber-300/70 bg-amber-50 text-amber-800 dark:border-amber-700/50 dark:bg-amber-900/30 dark:text-amber-200", draft: "border-slate-300/70 bg-slate-100 text-slate-700 dark:border-slate-700/60 dark:bg-slate-800/70 dark:text-slate-200", }; function initials(text: string): string { return text .split(" ") .filter(Boolean) .slice(0, 2) .map((chunk) => chunk[0]?.toUpperCase() ?? "") .join(""); } export default function CourseDetailHeader({ title, stageLabel, proficiencyLabel, availabilityLabel, availabilityState, description, thumbnailUrl, instructor, durationLabel, lessonCount, studentsCount, }: CourseDetailHeaderProps) { return (
Volver a Formación Académica
{stageLabel} {proficiencyLabel} {availabilityLabel}

{title}

{description}

Duración

{durationLabel}

Lecciones

{lessonCount}

Instructor

{instructor}

Comunidad

{studentsCount.toLocaleString()} inscritos

{thumbnailUrl ? ( {`Portada ) : (
{initials(title)}
)}
); }