import Image from "next/image"; import Link from "next/link"; import { ArrowUpLeft, Clock, Layers, Wallet } from "lucide-react"; import { Container } from "@/components/atoms/Container"; import { Heading } from "@/components/atoms/Heading"; import { Section } from "@/components/atoms/Section"; import { TextLink } from "@/components/atoms/TextLink"; import { DetailList, type DetailItem } from "@/components/molecules/DetailList"; import { PageHero } from "@/components/molecules/PageHero"; import { SurfaceCard } from "@/components/molecules/SurfaceCard"; import { CourseRegisterGate } from "@/components/organisms/CourseRegisterGate"; import { Badge } from "@/components/ui/badge"; import type { Course } from "@/lib/types"; import { courseCategoryHref, courseTagHref } from "@/lib/course-nav"; 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 instructors = course.instructors ?? []; const details: DetailItem[] = [ { icon: Layers, label: labels.format, value: formatLabel(course.format) }, ...(course.durationHours ? [ { icon: Clock, label: labels.duration, value: `${course.durationHours} ساعت`, }, ] : []), { icon: Wallet, label: labels.price, value: priceLabel ?? labels.priceUnset, emphasis: Boolean(priceLabel), }, ]; const hasTaxonomy = course.categories.length > 0 || course.tags.length > 0; return (
{course.title}
{labels.aboutTitle}

{course.seoDescription || course.summary}

{instructors.length > 0 ? (
اساتید
    {instructors.map((person) => { const body = ( <> {person.name} {person.title ? ( {person.title} ) : null} ); return (
  • {person.profileUrl ? ( {body} ) : (
    {body}
    )}
  • ); })}
) : null} {hasTaxonomy ? (
{labels.category}
{course.categories.map((c) => ( {c.label} ))} {course.tags.map((t) => ( {t.label} ))}
) : null}
); }