/** * SetupTab/SettingsSection.tsx — collapsible settings category section. * * Each category from /api/rag-settings renders as a
with a toggle * button (aria-expanded + aria-controls) that shows/hides its setting rows. * Matches the Sidebar collapsible-accessibility pattern. */ import type React from "react"; import { useState } from "react"; import { ChevronDown } from "lucide-react"; import { cn } from "../../utils/cn"; interface SettingsSectionProps { readonly title: string; readonly children: React.ReactNode; } export default function SettingsSection({ title, children, }: SettingsSectionProps): React.ReactElement { const [open, setOpen] = useState(true); const panelId = `settings-${title.toLowerCase().replace(/[^a-z0-9]+/g, "-")}`; return (
{open && (
{children}
)}
); }