diff options
Diffstat (limited to 'app/components/FilterBar.tsx')
| -rw-r--r-- | app/components/FilterBar.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/components/FilterBar.tsx b/app/components/FilterBar.tsx index 97a3c02..266865d 100644 --- a/app/components/FilterBar.tsx +++ b/app/components/FilterBar.tsx @@ -3,9 +3,11 @@ import type { Venue } from "~/lib/db.server"; interface Props { venues: Venue[]; + defaultDateFrom?: string; + defaultDateTo?: string; } -export default function FilterBar({ venues }: Props) { +export default function FilterBar({ venues, defaultDateFrom, defaultDateTo }: Props) { const [searchParams] = useSearchParams(); return ( @@ -45,7 +47,7 @@ export default function FilterBar({ venues }: Props) { <input name="date_from" type="date" - defaultValue={searchParams.get("date_from") ?? ""} + defaultValue={searchParams.get("date_from") ?? defaultDateFrom ?? ""} className="rounded-md bg-gray-800 border border-gray-700 px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-indigo-500" /> </div> @@ -56,7 +58,7 @@ export default function FilterBar({ venues }: Props) { <input name="date_to" type="date" - defaultValue={searchParams.get("date_to") ?? ""} + defaultValue={searchParams.get("date_to") ?? defaultDateTo ?? ""} className="rounded-md bg-gray-800 border border-gray-700 px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-indigo-500" /> </div> |
