import React, { useState } from 'react' import { Link, useParams } from 'react-router-dom' import { ArrowLeftIcon, ChevronLeftIcon } from 'lucide-react' import { Reveal } from '../components/Reveal' import { ButtonLink } from '../components/Button' import { ProjectCard } from '../components/ProjectCard' import { ContactSection } from '../components/ContactSection' import { Lightbox } from '../components/Lightbox' import { useEffect } from 'react'; import { useSite, useStatusLabel } from '../api'; import { useLang } from '../i18n/lang'; import { applySeo } from '../seo'; export function ProjectDetail() { const { slug } = useParams<{ slug: string }>() const { projects, brand } = useSite() const { t, href, lang } = useLang() const project = projects.find((p) => p.slug === slug) const statusLabel = useStatusLabel(project?.status ?? '') const [lightbox, setLightbox] = useState(null) // عنوان تب، توضیح متا و OG از خود پروژه useEffect(() => { if (!project) return; applySeo({ title: `${project.title} | ${brand.name}`, description: project.summary, path: href(`/projects/${project.slug}`), image: project.image, lang, }); }, [project?.id, lang, href]); if (!project) { return (

{t('projectNotFound')}

{t('projectNotFoundText')}

{t('backToProjects')}
) } const related = projects.filter((p) => p.slug !== project.slug).slice(0, 3) const facts = [ { label: t('specLocation'), value: project.location }, { label: t('specYear'), value: project.year }, { label: t('specArea'), value: project.area }, { label: t('specFloors'), value: project.floors }, { label: t('specUnits'), value: project.units }, { label: t('specClient'), value: project.client }, ] return ( <>

{t('aboutProject')}

{project.body.map((para) => (

{para}

))}
{facts.map((f) => (
{f.label}
{f.value}
))}
{t('similarProjectCta')}
{project.gallery.slice(1).map((img, i) => ( ))}

{t('otherProjects')}

{related.map((item, i) => ( ))}
setLightbox(null)} onChange={setLightbox} /> ) }