import { useTranslation } from "react-i18next"; import { FakeSwitch } from "@/components/section-card"; import { useRailItems } from "./rail-items"; /** * Appearance > Sidebar > Navigation: one switch per rail destination, * including the ones plugins register, which appear and disappear here as * their plugin is turned on and off. */ export function NavigationVisibilityToggles({ hidden, onChange, }: { hidden: Set; onChange: (next: Set) => void; }) { const { t } = useTranslation(); const railItems = useRailItems(); return ( <> {railItems .filter((item) => item.hideable !== false) .map((item) => (
{t(item.labelKey)} { const next = new Set(hidden); if (visible) next.delete(item.id); else next.add(item.id); onChange(next); }} />
))} ); }