import Image from "next/image"; import Link from "next/link"; import type { ProjectType } from "@prisma/client"; import type { Locale } from "@/lib/i18n"; import { getProjectDirectoryCopy, getProjectPath } from "@/lib/project-content"; import AnalyticsTracker from "@/components/public/analytics-tracker"; import TrackedLink from "@/components/public/tracked-link"; type ProjectDetailProps = { locale: Locale; type: ProjectType; project: { id: string; slug: string; titleAr: string; titleEn: string; descAr: string | null; descEn: string | null; summaryAr: string | null; summaryEn: string | null; coverImage: string | null; images: string[]; technologies: string[]; externalUrl: string | null; repoUrl: string | null; platform: string | null; appStoreUrl: string | null; testflightUrl: string | null; appVersion: string | null; supportUrl: string | null; appPrivacyUrl: string | null; category: { nameAr: string; nameEn: string } | null; }; }; export default function ProjectDetail({ locale, type, project }: ProjectDetailProps) { const title = locale === "ar" ? project.titleAr : project.titleEn; const summary = locale === "ar" ? project.summaryAr : project.summaryEn; const description = locale === "ar" ? project.descAr : project.descEn; const category = project.category ? (locale === "ar" ? project.category.nameAr : project.category.nameEn) : null; const copy = getProjectDirectoryCopy(locale, type); const backLabel = locale === "ar" ? `العودة إلى ${copy.eyebrow}` : `Back to ${copy.eyebrow}`; const isApp = type === "APP"; return (
← {backLabel}
{category ?

{category}

: null}

{title}

{summary ?

{summary}

: null}
{project.coverImage ? (
{title}
) : null}
{description ?

{description}

: null} {project.images.length > 0 ? (
{project.images.map((image, index) => (
{`${title}
))}
) : null}
); }