From 841b776dcadb1237bcd094f954748803c3e435c0 Mon Sep 17 00:00:00 2001 From: pradeepkumar Date: Tue, 10 Feb 2026 21:00:23 +0530 Subject: [PATCH] feat: Add category selection dropdown and state management to the hero section search. --- src/components/home/HeroSection.tsx | 49 ++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/src/components/home/HeroSection.tsx b/src/components/home/HeroSection.tsx index 8aed144..13e17d9 100644 --- a/src/components/home/HeroSection.tsx +++ b/src/components/home/HeroSection.tsx @@ -10,11 +10,21 @@ export function HeroSection() { const router = useRouter(); const [agentTypes, setAgentTypes] = useState([]); const [searchParams, setSearchParams] = useState({ + category: '', type: '', name: '', location: '', }); const [openDropdown, setOpenDropdown] = useState(null); + + // Category options (UI only - no functionality) + const categoryOptions = [ + { id: 'residential', name: 'Residential' }, + { id: 'commercial', name: 'Commercial' }, + { id: 'industrial', name: 'Industrial' }, + { id: 'land', name: 'Land' }, + { id: 'rental', name: 'Rental' }, + ]; const [validationError, setValidationError] = useState(null); // Fetch agent types on mount @@ -59,6 +69,11 @@ export function HeroSection() { setOpenDropdown(openDropdown === dropdown ? null : dropdown); }; + const selectCategory = (value: string) => { + setSearchParams({ ...searchParams, category: value }); + setOpenDropdown(null); + }; + const selectType = (value: string) => { setSearchParams({ ...searchParams, type: value }); setOpenDropdown(null); @@ -103,7 +118,7 @@ export function HeroSection() {
{/* Type Select */} -
+
+ {/* Category Select (UI only) */} +
+ + {openDropdown === 'category' && ( +
+ {categoryOptions.map((category, index, arr) => ( + + ))} +
+ )} +
+ {/* Search Button */}