'use client' import { useState } from 'react' import Link from 'next/link' import { Button } from "~/components/ui/button" import { Input } from "~/components/ui/input" import { Card, CardContent, CardFooter, CardHeader, CardTitle } from "~/components/ui/card" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "~/components/ui/select" import { Slider } from "~/components/ui/slider" import { Search, Home, Bed, Bath, Square } from 'lucide-react' // Mock data for properties const properties = Array.from({ length: 12 }, (_, i) => ({ id: i + 1, title: `Property ${i + 1}`, type: i % 3 === 0 ? 'House' : i % 3 === 1 ? 'Apartment' : 'Condo', bedrooms: Math.floor(Math.random() * 5) + 1, bathrooms: Math.floor(Math.random() * 3) + 1, area: Math.floor(Math.random() * 1000) + 500, price: Math.floor(Math.random() * 500000) + 100000, })) export default function PropertiesPage() { const [sortBy, setSortBy] = useState('price') const [filterType, setFilterType] = useState('All') const [priceRange, setPriceRange] = useState([0, 1000000]) const [searchTerm, setSearchTerm] = useState('') const filteredAndSortedProperties = properties .filter(property => (filterType === 'All' || property.type === filterType) && property.price >= priceRange[0] && property.price <= priceRange[1] && property.title.toLowerCase().includes(searchTerm.toLowerCase()) ) .sort((a, b) => { if (sortBy === 'price') return a.price - b.price if (sortBy === 'bedrooms') return b.bedrooms - a.bedrooms return 0 }) return (
${property.price.toLocaleString()}