'use client'; import React, { useState, useEffect, useMemo } from 'react'; import { Navbar, NavbarBrand, NavbarLinks, NavbarLink, NavbarActions, } from '../../renderers/react/Navbar'; import { BackToTop } from '../../renderers/react/BackToTop'; import { Pagination } from '../../renderers/react/patterns/Pagination'; import { LuxuryProductCard } from '../../renderers/react/patterns/LuxuryProductCard'; import { Icon } from '../../renderers/react/Icon'; export function ShopPage() { const [theme, setTheme] = useState<'dark' | 'light'>('dark'); const [viewMode, setViewMode] = useState<'grid' | 'list'>('grid'); const [searchQuery, setSearchQuery] = useState(''); const [selectedCategory, setSelectedCategory] = useState('all'); const [maxPrice, setMaxPrice] = useState(5000); const [selectedColors, setSelectedColors] = useState([]); const [selectedSizes, setSelectedSizes] = useState([]); const [selectedBrands, setSelectedBrands] = useState([]); const [currentPage, setCurrentPage] = useState(1); const [cartCount, setCartCount] = useState(1); useEffect(() => { const saved = localStorage.getItem('qhr-theme') as 'dark' | 'light' | null; if (saved) setTheme(saved); }, []); const toggleTheme = () => { const next = theme === 'dark' ? 'light' : 'dark'; setTheme(next); localStorage.setItem('qhr-theme', next); }; const categories = [ { id: 'rings', name: 'الخواتم الملكية' }, { id: 'bracelets', name: 'الأساور والمصوغات' }, { id: 'necklaces', name: 'السلاسل والقلائد' }, { id: 'earrings', name: 'الأقراط والبروشات' }, { id: 'watches', name: 'الساعات والتحف' }, ]; const colorOptions = [ { id: 'gold', name: 'ذهب إمبراطوري', hex: '#D4AF37' }, { id: 'silver', name: 'ستيل فضي 316L', hex: '#CBD5E1' }, { id: 'obsidian', name: 'أوبسيديان أسود', hex: '#1C1917' }, { id: 'rosegold', name: 'ذهب وردي', hex: '#E0A899' }, { id: 'bronze', name: 'برونز عتيق', hex: '#A87C4F' }, ]; const sizeOptions = ['6', '7', '8', '9', '10', 'S', 'M', 'L', 'XL', '45cm', '50cm']; const brandOptions = [ { id: 'alqahera', name: 'دار قاهرة الفاخرة' }, { id: 'alhoulie', name: 'الحولي للأحجار الكريمة' }, { id: 'elsagha', name: 'ورشة الصاغة التراثية' }, { id: 'nile', name: 'النيل للأوبسيديان' }, ]; const products = [ { id: 'prod-1', title: 'خاتم الأفق الذهبي عيار 18', category: 'rings', brandId: 'alqahera', price: '1,850 ر.س', numericPrice: 1850, badgeText: 'ستيل 316L', colorId: 'gold', sizes: ['7', '8', '9'], material: 'Steel 316L · مطلي ذهب PVD', collection: 'دار قاهرة الفاخرة', }, { id: 'prod-2', title: 'سوار النيل الملكي المنقوش', category: 'bracelets', brandId: 'alhoulie', price: '1,450 ر.س', numericPrice: 1450, badgeText: 'مقاوم للماء', colorId: 'silver', sizes: ['S', 'M', 'L'], material: 'Steel 316L · صقل مصمت', collection: 'الحولي للأحجار الكريمة', }, { id: 'prod-3', title: 'قلادة المشربية الفاطمية', category: 'necklaces', brandId: 'elsagha', price: '2,100 ر.س', numericPrice: 2100, badgeText: 'صناعة يدوية', colorId: 'gold', sizes: ['45cm', '50cm'], material: 'Steel 316L · طلاء ذهب عيار 18', collection: 'ورشة الصاغة التراثية', }, { id: 'prod-4', title: 'سوار الهيبة الأوبسيدياني', category: 'bracelets', brandId: 'nile', price: '1,250 ر.س', numericPrice: 1250, badgeText: 'أوبسيديان بركاني', colorId: 'obsidian', sizes: ['M', 'L'], material: 'Obsidian Stone & Steel 316L', collection: 'النيل للأوبسيديان', }, ]; const filtered = useMemo(() => { return products.filter((p) => { if (selectedCategory !== 'all' && p.category !== selectedCategory) return false; if (p.numericPrice > maxPrice) return false; if (selectedColors.length > 0 && !selectedColors.includes(p.colorId)) return false; if (selectedSizes.length > 0 && !p.sizes.some((s) => selectedSizes.includes(s))) return false; if (selectedBrands.length > 0 && !selectedBrands.includes(p.brandId)) return false; if (searchQuery.trim() !== '' && !p.title.includes(searchQuery)) return false; return true; }); }, [products, selectedCategory, maxPrice, selectedColors, selectedSizes, selectedBrands, searchQuery]); return (
{/* 1. Header */} ق قاهرة للمقتنيات الفاخرة المتجر الشامل الخواتم الملكية الأساور صالات العرض {cartCount} قطع {/* 2. Main Layout */}
{/* Sidebar Filters */} {/* Catalog Main */}

متجر المقتنيات الملكية

عرض {filtered.length} منتجات مطابقة
{/* Products Grid */}
{filtered.map((prod) => ( setCartCount((c) => c + 1)} /> ))}
); }