'use client'; import { useState } from 'react'; import { motion } from 'framer-motion'; import { useTranslation } from 'react-i18next'; import { Search, MapPin, Home, DollarSign } from 'lucide-react'; export default function HeroSearch({ onSearch }) { const { t } = useTranslation(); const [activeTab, setActiveTab] = useState('rent'); const [filters, setFilters] = useState({ city: '', propertyType: '', priceRange: '', identityType: 'syrian' }); const cities = [ { id: 'all', label: 'جميع المدن' }, { id: 'دمشق', label: 'دمشق' }, { id: 'حلب', label: 'حلب' }, { id: 'حمص', label: 'حمص' }, { id: 'اللاذقية', label: 'اللاذقية' }, { id: 'درعا', label: 'درعا' } ]; const propertyTypes = [ { id: 'all', label: 'الكل' }, { id: 'apartment', label: 'شقة' }, { id: 'villa', label: 'فيلا' }, { id: 'house', label: 'بيت' }, { id: 'studio', label: 'استوديو' } ]; const priceRanges = [ { id: 'all', label: 'جميع الأسعار' }, { id: '0-500', label: 'أقل من 50$' }, { id: '500-1000', label: '50$ - 100$' }, { id: '1000-2000', label: '100$ - 200$' }, { id: '2000-3000', label: '200$ - 300$' }, { id: '3000+', label: 'أكثر من 300$' } ]; const identityTypes = [ { id: 'syrian', label: 'هوية سورية' }, { id: 'passport', label: 'جواز سفر' } ]; const handleSearch = () => { onSearch({ ...filters, propertyType: filters.propertyType || 'all', city: filters.city || 'all', priceRange: filters.priceRange || 'all' }); }; return (
{['rent', 'buy', 'sell'].map((tab) => ( setActiveTab(tab)} className={`px-4 py-2 rounded-lg font-medium text-sm transition-all ${ activeTab === tab ? 'bg-amber-500 text-white' : 'bg-white/20 text-white hover:bg-white/30' }`} whileHover={{ scale: 1.05 }} whileTap={{ scale: 0.95 }} > {t(`${tab}Tab`)} ))}
{t("searchButton")}
); }