import { useState } from 'react'; interface Props { brands: { name: string; slug: string; count: number }[]; currentBrand: string; currentGender: string; currentSize: string; currentSort: string; basePath?: string; } const EU_SIZES = ['36', '37', '37.5', '38', '38.5', '39', '40', '40.5', '41', '42', '42.5', '43', '44', '44.5', '45', '46', '47', '48', '49']; export default function CatalogFilters({ brands, currentBrand, currentGender, currentSize, currentSort, basePath = '/sneakers' }: Props) { const [mobileOpen, setMobileOpen] = useState(false); const [brandSearch, setBrandSearch] = useState(''); function applyFilter(key: string, value: string) { const params = new URLSearchParams(window.location.search); if (value) { params.set(key, value); } else { params.delete(key); } params.delete('pagina'); window.location.href = `${basePath}?${params.toString()}`; } const filteredBrands = brands.filter(b => b.name.toLowerCase().includes(brandSearch.toLowerCase())); const genders = [ { value: '', label: 'Alle' }, { value: 'heren', label: 'Heren' }, { value: 'dames', label: 'Dames' }, { value: 'unisex', label: 'Unisex' }, ]; const sortOptions = [ { value: 'popular', label: 'Populair' }, { value: 'newest', label: 'Nieuwste' }, { value: 'price_asc', label: 'Prijs ↑' }, { value: 'price_desc', label: 'Prijs ↓' }, { value: 'discount', label: 'Korting' }, ]; const content = (