'use client'; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import Image from 'next/image'; const propertyTypes = [ { value: '', label: 'Types' }, { value: 'professionals', label: 'Professionals' }, { value: 'lenders', label: 'Lenders' }, ]; const categories = [ { value: '', label: 'Categories' }, { value: 'luxury-homes', label: 'Luxury Homes' }, { value: 'commercial', label: 'Commercial' }, { value: 'mortgages', label: 'Mortgages' }, ]; 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.slice(1).map((type, index, arr) => ( ))}
)}
{/* Name Input */}
setSearchParams({ ...searchParams, name: e.target.value })} className="w-full h-[42px] px-4 rounded-[7px] border border-[#00293d]/10 bg-white font-serif text-sm text-[#00293d] placeholder:text-[#00293d] focus:outline-none" />
{/* Location Input */}
setSearchParams({ ...searchParams, location: e.target.value })} className="w-full h-[42px] px-4 rounded-[7px] border border-[#00293d]/10 bg-white font-serif text-sm text-[#00293d] placeholder:text-[#00293d] focus:outline-none" />
{/* Category Select */}
{openDropdown === 'category' && (
{categories.slice(1).map((cat, index, arr) => ( ))}
)}
{/* Search Button */}
{/* Bottom Section - pushed to bottom */}
{/* See All Agents Button */}
{/* Helper Text */}

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

); }