diff --git a/frontend/src/components/home/FeaturedProjects.tsx b/frontend/src/components/home/FeaturedProjects.tsx index 72adad0..304f3ef 100644 --- a/frontend/src/components/home/FeaturedProjects.tsx +++ b/frontend/src/components/home/FeaturedProjects.tsx @@ -1,87 +1,37 @@ -import React, { useState } from 'react' +import React from 'react' import { AnimatePresence, motion } from 'framer-motion' import { Reveal } from '../Reveal' import { PremiumButton } from '../PremiumButton' import { ProjectCard } from '../ProjectCard' import { SectionHeading } from '../SectionHeading' -import { useSectionHeading, useSite, useStatusLabel } from '../../api' +import { useSectionHeading, useSite } from '../../api' import { useFieldSaver } from '../../admin/AdminContext' import { useLang } from '../../i18n/lang' import { InlineEdit } from '../admin/InlineEdit' -import type { ProjectStatus } from '../../data/site' export function FeaturedProjects() { - const { status_labels, projects } = useSite() - const { t, href } = useLang() + const { projects } = useSite() + const { href } = useLang() const heading = useSectionHeading('featured_projects') const save = useFieldSaver() - const saveStatusLabel = (key: string, value: string) => { - const label = status_labels.find((s) => s.key === key) - if (!label) return - void save('status-labels', label.id, { label: value }, (d) => { - const s = d.status_labels.find((x) => x.id === label.id) - if (s) s.label = value - }) - } - - const FILTERS: { key: ProjectStatus; label: string }[] = [ - { key: 'done', label: useStatusLabel('done') }, - { key: 'progress', label: useStatusLabel('progress') }, - ] - - const [status, setStatus] = useState('done') - - // سه پروژه از دیتابیس — ویرایش پنل همان‌جا اعمال می‌شود - const list = projects.filter((p) => p.status === status).slice(0, 3) - const BASE_IMG_URL = "/seed-media/2026/09/"; + // سه پروژهٔ ثابت صفحهٔ اصلی — بدون تب وضعیت؛ ویرایش پنل همان‌جا اعمال می‌شود + const FEATURED_TITLES = ['آرامش - بابک', 'آرامش - میرزاطاهر 3', 'آرامش - میرزا طاهر 5'] + const list = projects.filter((p) => FEATURED_TITLES.includes(p.title)) + .sort((a, b) => FEATURED_TITLES.indexOf(a.title) - FEATURED_TITLES.indexOf(b.title)) return (
- {/* دکمه‌های فیلتر مینیمال و شیشه‌ای (بدون کادر) */} -
- {FILTERS.map((filter, index) => { - const isSelected = status === filter.key - return ( - - {index > 0 && ( - - ) - })} -
-