// Listings index — filters + grid + map toggle const ListingsPage = ({ openListing, faves, toggleFav }) => { useLucide(); const [view, setView] = React.useState('grid'); // grid | map const [filters, setFilters] = React.useState({ type: 'all', // House, Townhouse, Condo minBeds: 0, priceBand: 'all', sort: 'newest', }); const filtered = SITE_DATA.listings.filter(l => { if (filters.type !== 'all' && l.type !== filters.type) return false; if (l.beds < filters.minBeds) return false; if (filters.priceBand === 'u750' && l.price >= 750000) return false; if (filters.priceBand === '750-1.2' && (l.price < 750000 || l.price >= 1200000)) return false; if (filters.priceBand === '1.2-2' && (l.price < 1200000 || l.price >= 2000000)) return false; if (filters.priceBand === '2+' && l.price < 2000000) return false; return true; }); const sorted = [...filtered].sort((a, b) => { if (filters.sort === 'price-asc') return a.price - b.price; if (filters.sort === 'price-desc') return b.price - a.price; if (filters.sort === 'beds') return b.beds - a.beds; return 0; }); return (
Currently for sale

Active listings

{SITE_DATA.listings.length} properties I'm representing across Metro Vancouver. Filter by type, beds, or budget — or switch to map view to explore by location.

{sorted.length} homes
{sorted.length === 0 && (

No homes match these filters. Try widening your search.

)} {view === 'grid' && sorted.length > 0 && (
{sorted.map(l => ( ))}
)} {view === 'map' && sorted.length > 0 && }
); }; // Decorative "map" — gives the right interaction without needing real maps const MapPane = ({ listings, openListing }) => { const [activeId, setActiveId] = React.useState(null); // Deterministic positions across the canvas based on listing id const positions = listings.map((l, i) => { const seed = l.id.charCodeAt(1) + l.id.charCodeAt(2) + i * 13; return { top: 20 + (seed * 7) % 60, left: 12 + (seed * 11) % 76, }; }); return (
{/* Decorative road lines */} {listings.map((l, i) => ( ))}
Metro Vancouver
{listings.map(l => (
setActiveId(l.id)} style={{ display: 'grid', gridTemplateColumns: '120px 1fr', gap: 16, padding: 12, borderRadius: 'var(--radius-md)', border: '1px solid ' + (activeId === l.id ? 'var(--accent)' : 'var(--line)'), background: 'var(--bg-card)', cursor: 'pointer', transition: 'border-color var(--dur) var(--ease)', }} onClick={() => openListing(l)} >
{l.address}
{formatFullPrice(l.price)}
{l.address}
{l.neighbourhood} · {l.city}
{l.beds} bed · {l.baths} bath · {l.sqft.toLocaleString()} sqft
))}
); }; window.MapPane = MapPane; window.ListingsPage = ListingsPage;