import Image from "next/image"; import { Clock, Layers, Tag, Wallet } from "lucide-react"; import { Container } from "@/components/atoms/Container"; import { Section } from "@/components/atoms/Section"; import { TextLink } from "@/components/atoms/TextLink"; import { PageHero } from "@/components/molecules/PageHero"; import { CourseRegisterGate } from "@/components/organisms/CourseRegisterGate"; import { Separator } from "@/components/ui/separator"; import type { Course } from "@/lib/types"; import { formatCoursePrice, formatLabel } from "@/lib/labels"; import { JsonLd, courseJsonLd } from "@/lib/seo/json-ld"; export type CourseDetailLabels = { submit: string; success: string; cta: string; formTitle: string; formDescription: string; hint: string; cancel: string; backToCatalog: string; detailsTitle: string; aboutTitle: string; duration: string; format: string; category: string; price: string; priceUnset: string; }; export function CourseDetailTemplate({ course, labels, }: { course: Course; labels: CourseDetailLabels; }) { const priceLabel = formatCoursePrice(course.price); const categoryText = course.categories.map((c) => c.label).join(" · ") || "—"; const specs = [ { icon: Tag, label: labels.category, value: categoryText, }, { icon: Layers, label: labels.format, value: formatLabel(course.format), }, ...(course.durationHours ? [ { icon: Clock, label: labels.duration, value: `${course.durationHours} ساعت`, }, ] : []), ...(priceLabel ? [ { icon: Wallet, label: labels.price, value: priceLabel, }, ] : []), ]; return (
{course.title}

{labels.aboutTitle}

{course.summary}

{course.seoDescription && course.seoDescription !== course.summary ? (

{course.seoDescription}

) : null}

{labels.detailsTitle}

{specs.map((item) => (
{item.label}
{item.value}
))}
); }