'use client'; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import Image from 'next/image'; const propertyTypes = [ { value: '', label: 'Types' }, { value: 'residential', label: 'Residential' }, { value: 'commercial', label: 'Commercial' }, { value: 'luxury', label: 'Luxury Homes' }, { value: 'rentals', label: 'Rentals' }, ]; const categories = [ { value: '', label: 'Categories' }, { value: 'luxury-broker', label: 'Luxury Broker' }, { value: 'buying', label: 'Buying Agent' }, { value: 'selling', label: 'Selling Agent' }, { value: 'investment', label: 'Investment' }, { value: 'property-management', label: 'Property Management' }, ]; const quickFilters = [ { label: 'Professionals', value: 'professionals' }, { label: 'Lenders', value: 'lenders' }, { label: 'Agent', value: 'agent' }, ]; export function HeroSection() { const router = useRouter(); const [searchParams, setSearchParams] = useState({ type: '', name: '', location: '', category: '', }); const [openDropdown, setOpenDropdown] = useState(null); const handleSearch = () => { const params = new URLSearchParams(); if (searchParams.type) params.set('type', searchParams.type); if (searchParams.name) params.set('name', searchParams.name); if (searchParams.location) params.set('location', searchParams.location); if (searchParams.category) params.set('category', searchParams.category); router.push(`/agents?${params.toString()}`); }; const handleSeeAllAgents = () => { router.push('/agents'); }; const toggleDropdown = (dropdown: string) => { setOpenDropdown(openDropdown === dropdown ? null : dropdown); }; const selectOption = (field: 'type' | 'category', value: string, label: string) => { setSearchParams({ ...searchParams, [field]: value }); setOpenDropdown(null); }; return (
{/* Background Image */}
{/* Headline */}

“Discover verified, top-rated real estate professionals to guide your buying, selling, or investing journey.”

“Discover verified, top-rated real estate professionals.”

{/* Search Form */}
{/* Type Select */}
{openDropdown === 'type' && (
{propertyTypes.map((type) => ( ))}
)}
{/* Name Input */}
setSearchParams({ ...searchParams, name: e.target.value })} className="w-full px-4 py-3 rounded-[10px] border-2 border-[#e58625] bg-white font-serif text-sm text-[#00293d] placeholder:text-[#00293d]/50 focus:outline-none focus:ring-2 focus:ring-[#e58625]/30" />
{/* Location Input */}
setSearchParams({ ...searchParams, location: e.target.value })} className="w-full px-4 py-3 rounded-[10px] border-2 border-[#e58625] bg-white font-serif text-sm text-[#00293d] placeholder:text-[#00293d]/50 focus:outline-none focus:ring-2 focus:ring-[#e58625]/30" />
{/* Category Select */}
{openDropdown === 'category' && (
{categories.map((cat) => ( ))}
)}
{/* Search Button */}
{/* Quick Filter Links */}
{quickFilters.map((filter, index) => ( {index < quickFilters.length - 1 && ( | )} ))}
{/* See All Agents Button */}
{/* Helper Text */}

Connect with trusted local agents to explore homes, compare options, and make smarter decisions.

); }