'use client'; import { useState } from 'react'; import { useRouter } from 'next/navigation'; const PropertySearchForm = () => { const [location, setLocation] = useState(''); const [propertyType, setPropertyType] = useState('All'); const router = useRouter(); const handleSubmit = (e) => { e.preventDefault(); if (location === '' && propertyType === 'All') { router.push('/properties'); } else { const query = `?location=${location}&propertyType=${propertyType}`; router.push(`/properties/search-results${query}`); } }; return (
); }; export default PropertySearchForm;