import Image from "next/image"; import Link from "next/link"; import type { ProjectType } from "@prisma/client"; import type { Locale } from "@/lib/i18n"; import { getProjectPath } from "@/lib/project-content"; type ProjectCardProps = { locale: Locale; type: ProjectType; project: { slug: string; titleAr: string; titleEn: string; summaryAr: string | null; summaryEn: string | null; coverImage: string | null; category: { nameAr: string; nameEn: string } | null; }; }; export default function ProjectCard({ locale, type, project }: ProjectCardProps) { const title = locale === "ar" ? project.titleAr : project.titleEn; const summary = locale === "ar" ? project.summaryAr : project.summaryEn; const category = project.category ? (locale === "ar" ? project.category.nameAr : project.category.nameEn) : null; return (
{project.coverImage ? ( {title} ) : (
{title}
)}
{category ?

{category}

: null}

{title}

{summary ?

{summary}

: null}
); }