// SONARA — Collapsible filter section (shared) // Use inside .filter-rail to replace plain
. // Header is clickable, body collapses smoothly. Active-filter count appears next to title. function FilterSection({ title, count = 0, defaultOpen = true, children }) { const storageKey = "sonara-filter-section-" + title.toLowerCase().replace(/[^a-z0-9]+/g, "-"); const [open, setOpen] = React.useState(() => { try { const v = localStorage.getItem(storageKey); if (v === null) return defaultOpen; return v === "1"; } catch (e) { return defaultOpen; } }); React.useEffect(() => { try { localStorage.setItem(storageKey, open ? "1" : "0"); } catch (e) {} }, [open, storageKey]); return (
0 ? "has-count" : ""}`}>
{children}
); } // Toolbar button to toggle the whole rail function RailToggleButton({ open, onChange, activeCount = 0 }) { return ( ); } window.FilterSection = FilterSection; window.RailToggleButton = RailToggleButton;