diff --git a/app/client/services/page.tsx b/app/client/services/page.tsx
new file mode 100644
index 0000000..80f432e
--- /dev/null
+++ b/app/client/services/page.tsx
@@ -0,0 +1,163 @@
+'use client'
+
+import { useState, useEffect } from 'react'
+import { useRouter } from 'next/navigation'
+import Link from 'next/link'
+import { ArrowLeft, Settings, Sparkles, Home, AlertTriangle, PenTool, Wrench, Zap, Droplets, Wind, Truck, Search } from 'lucide-react'
+import { createClient } from '@/lib/supabase/client'
+
+const iconMap: Record
= {
+ painting: ,
+ carpentry: ,
+ plumbing: ,
+ electricity: ,
+ ac: ,
+ cleaning: ,
+ moving: ,
+ default:
+}
+
+const TOPICS = [
+ { id: 'maintenance', label: 'صيانة وتصليح', icon: , color: 'from-blue-600 to-cyan-600' },
+ { id: 'construction', label: 'تشطيبات وديكور', icon: , color: 'from-purple-600 to-indigo-600' },
+ { id: 'cleaning', label: 'نظافة وعناية', icon: , color: 'from-teal-500 to-emerald-500' },
+ { id: 'emergency', label: 'خدمات الطوارئ', icon: , color: 'from-red-500 to-orange-500' },
+]
+
+const HARDCODED_CATEGORIES = [
+ { id: 'painting', label_ar: 'دهان', icon: 'painting', topicId: 'construction' },
+ { id: 'carpentry', label_ar: 'نجارة', icon: 'carpentry', topicId: 'maintenance' },
+ { id: 'plumbing', label_ar: 'سباكة', icon: 'plumbing', topicId: 'maintenance' },
+ { id: 'electricity', label_ar: 'كهرباء', icon: 'electricity', topicId: 'maintenance' },
+ { id: 'ac', label_ar: 'تكييف', icon: 'ac', topicId: 'maintenance' },
+ { id: 'cleaning', label_ar: 'تنظيف', icon: 'cleaning', topicId: 'cleaning' },
+ { id: 'moving', label_ar: 'نقل عفش', icon: 'moving', topicId: 'general' },
+]
+
+export default function MainServicesPage() {
+ const router = useRouter()
+ const supabase = createClient()
+ const [categories, setCategories] = useState(HARDCODED_CATEGORIES)
+ const [loading, setLoading] = useState(true)
+ const [searchQuery, setSearchQuery] = useState('')
+ const [activeTopic, setActiveTopic] = useState('all')
+
+ useEffect(() => {
+ const fetchCategories = async () => {
+ setLoading(true)
+ const { data } = await supabase.from('categories').select('*').order('usage_count', { ascending: false })
+ if (data && data.length > 0) {
+ const merged = data.map(dbCat => {
+ const hc = HARDCODED_CATEGORIES.find(c => c.id === dbCat.id)
+ return { ...dbCat, topicId: hc?.topicId || 'general' }
+ })
+ setCategories(merged)
+ }
+ setLoading(false)
+ }
+ fetchCategories()
+ }, [supabase])
+
+ const filteredCategories = categories.filter(c => {
+ const matchesSearch = c.label_ar.includes(searchQuery)
+ const matchesTopic = activeTopic === 'all' || c.topicId === activeTopic
+ return matchesSearch && matchesTopic
+ })
+
+ return (
+
+
+
+
+
الخدمات والتخصصات
+
+
+
+
+
+
+
+ setSearchQuery(e.target.value)}
+ />
+
+
+
+
+
+
التخصصات (Topics)
+
+ {TOPICS.map(topic => (
+
+ ))}
+
+
+
+
+
+
+ {activeTopic === 'all' ? 'جميع الخدمات' : TOPICS.find(t => t.id === activeTopic)?.label}
+
+ {activeTopic !== 'all' && (
+
+ )}
+
+
+ {loading ? (
+
+ {[1,2,3,4,5,6].map(i => (
+
+ ))}
+
+ ) : filteredCategories.length === 0 ? (
+
+
+
لا توجد خدمات مطابقة لبحثك
+
+ ) : (
+
+ {filteredCategories.map(cat => {
+ const icon = iconMap[cat.icon || 'default'] || iconMap.default
+ return (
+
+
+
{cat.label_ar}
+
+ )
+ })}
+
+ )}
+
+
+
+ )
+}