import{MapPin,Search,SlidersHorizontal}from"lucide-react";import{EventCard}from"../../components/event-card";import{SiteFooter,SiteHeader}from"../../components/site-shell";import{categories,events}from"../../lib/data";
export default async function Discover({searchParams}:{searchParams:Promise<{q?:string;category?:string}>}){const p=await searchParams;const q=(p.q||"").toLowerCase(),cat=p.category||"";const filtered=events.filter(e=>(!q||`${e.title} ${e.venue} ${e.city}`.toLowerCase().includes(q))&&(!cat||e.category===cat));return <div><SiteHeader/><main><section className="simple-hero"><span className="section-kicker">Explore what&apos;s next</span><h1>Find your kind of unforgettable.</h1><p>All prices shown include mandatory service fees, so the number you see is the real ticket price.</p></section><form className="filter-bar"><label className="filter-search"><Search size={18}/><input name="q" defaultValue={p.q} placeholder="Event, artist or venue"/></label><label className="filter-location"><MapPin size={18}/><input placeholder="Orange County, CA"/></label><select name="category" defaultValue={cat} aria-label="Category"><option value="">All categories</option>{categories.map(c=><option key={c.name}>{c.name}</option>)}</select><button><SlidersHorizontal size={17}/> Search</button></form><section className="page-wrap discover-results"><div className="results-head"><div><h2>{filtered.length} events</h2><p>Upcoming experiences around Southern California</p></div><select aria-label="Sort"><option>Recommended</option><option>Price: low to high</option><option>Date: soonest</option></select></div><div className="events-grid">{filtered.map(e=><EventCard event={e} key={e.slug}/>)}</div>{!filtered.length&&<div className="empty-state"><Search size={32}/><h2>No events match that search</h2><p>Try a different artist, venue, city or category.</p><a href="/discover">Clear filters</a></div>}</section></main><SiteFooter/></div>}
