انتقال تمام محتوای متنی سایت به دیتابیس — همه متن‌های فرانت‌اند از GET /api/site خوانده می‌شوند

This commit is contained in:
MMD
2026-09-06 20:16:17 +03:30
parent 8bb303dda2
commit 1fde4e30fc
36 changed files with 1096 additions and 454 deletions
+9 -11
View File
@@ -4,25 +4,23 @@ import { Reveal } from '../components/Reveal';
import { ProjectCard } from '../components/ProjectCard';
import { Gallery } from '../components/home/Gallery';
import { ContactSection } from '../components/ContactSection';
import { IMAGES, type ProjectStatus } from '../data/site';
import { useSite } from '../api';
const FILTERS: {key: ProjectStatus;label: string;}[] = [
{ key: 'done', label: 'انجام شده' },
{ key: 'progress', label: 'در حال انجام' }];
import type { ProjectStatus } from '../data/site';
import { usePageHero, useSite, useStatusLabel } from '../api';
export function Projects() {
const { projects } = useSite();
const hero = usePageHero('projects');
const doneLabel = useStatusLabel('done');
const progressLabel = useStatusLabel('progress');
const FILTERS: {key: ProjectStatus;label: string;}[] = [
{ key: 'done', label: doneLabel },
{ key: 'progress', label: progressLabel }];
const [status, setStatus] = useState<ProjectStatus>('done');
const list = projects.filter((p) => p.status === status);
return (
<>
<PageHero
title="پروژه‌ها"
lead="مجموعه‌ای از برج‌های مسکونی، مراکز تجاری و ویلاهای اختصاصی؛ از پروژه‌های تحویل‌شده تا کارگاه‌های فعال امروز."
image={IMAGES[0]} />
<PageHero title={hero.title} lead={hero.lead} image={hero.image} />
<section className="bg-ink py-24 lg:py-32" aria-label="فهرست پروژه‌ها">