import React from 'react'; import { DATA_SECTIONS, DataSection } from '../../lib/types'; import { ToggleSwitch } from '../../components/ToggleSwitch'; interface SectionPickerProps { value: DataSection[]; onChange: (sections: DataSection[]) => void; label?: string; } // Which parts of the own data a restore or import covers; one switch per section, at least one stays on export const SectionPicker: React.FC = ({ value, onChange, label = 'Bereiche' }) => (

{label}

{DATA_SECTIONS.map((sec) => { const on = value.includes(sec.id); return (
{sec.label} { const next = on ? value.filter((v) => v !== sec.id) : [...value, sec.id]; if (next.length > 0) onChange(next); }} />
); })}
);