diff --git a/app/src/pages/ComparisonsListPage.jsx b/app/src/pages/ComparisonsListPage.jsx new file mode 100644 index 0000000..0fcc20e --- /dev/null +++ b/app/src/pages/ComparisonsListPage.jsx @@ -0,0 +1,72 @@ +import { useState, useMemo } from 'react'; +import { TeknavData } from '../../teknav-data.js'; +import { useNav, EmptyState, inputStyle } from '../../teknav-ui.jsx'; + +const CATEGORY_COLORS = { ai: '#0F6B73', data: '#2F8F6B', security: '#C62828', software: '#1565C0', hardware: '#6A1B9A' }; + +export function ComparisonsListPage() { + const { navigate } = useNav(); + const comparisons = TeknavData.comparisons ?? []; + const [search, setSearch] = useState(''); + + const filtered = useMemo(() => { + if (!search.trim()) return comparisons; + const q = search.trim().toLocaleLowerCase('fa-IR'); + return comparisons.filter((c) => + c.title.toLocaleLowerCase('fa-IR').includes(q) || + c.item1.name.toLocaleLowerCase('en-US').includes(q) || + c.item2.name.toLocaleLowerCase('en-US').includes(q) || + (c.tags || []).some((t) => t.toLocaleLowerCase().includes(q)), + ); + }, [comparisons, search]); + + return ( +
+ +

مقایسه‌های فنی تکناو

+

+ تحلیل‌های مقایسه‌ای جامع میان فناوری‌ها، فریم‌ورک‌ها و ابزارهای رایج — برای انتخاب بهتر در پروژه‌های فارسی‌زبان. +

+ setSearch(e.target.value)} + style={{ ...inputStyle, marginBottom: 28, width: '100%', maxWidth: 400 }} + /> +
+ {filtered.map((c) => ( +
navigate(`/compare/${c.slug}`)} + style={{ background: '#fff', border: '1px solid #E4DDD2', borderRadius: 12, padding: '20px 24px', cursor: 'pointer', display: 'flex', gap: 20, alignItems: 'center' }} + onMouseEnter={(e) => { e.currentTarget.style.boxShadow = '0 4px 16px rgba(0,0,0,0.09)'; }} + onMouseLeave={(e) => { e.currentTarget.style.boxShadow = ''; }} + > +
+
+ + {c.category} + + {(c.tags || []).slice(0, 3).map((t) => ( + {t} + ))} +
+

{c.title}

+
+ {c.item1.name} + در برابر + {c.item2.name} +
+
+ ← +
+ ))} + {filtered.length === 0 && } +
+
+ ); +}