/** * Sichtbarkeit der Teile im Schnelleingabe-Widget (Dashboard-Lab). * Default: alle sichtbar (leeres config). */ const KEYS = [ { key: 'show_weight', label: 'Gewicht' }, { key: 'show_resting_hr', label: 'Ruhepuls' }, { key: 'show_hrv', label: 'HRV' }, { key: 'show_vo2_max', label: 'VO₂max' }, ] function mergeFromConfig(config) { const c = config || {} return { show_weight: c.show_weight !== false, show_resting_hr: c.show_resting_hr !== false, show_hrv: c.show_hrv !== false, show_vo2_max: c.show_vo2_max !== false, } } /** @param {{ config: Record, onChange: (next: Record) => void }} props */ export default function QuickCaptureConfigEditor({ config, onChange }) { const vis = mergeFromConfig(config) const setKey = (k, checked) => { const next = { ...vis, [k]: checked } if (!next.show_weight && !next.show_resting_hr && !next.show_hrv && !next.show_vo2_max) { return } const stored = {} for (const { key } of KEYS) { if (!next[key]) stored[key] = false } onChange(stored) } const resetAllVisible = () => onChange({}) return (
Schnelleingabe: welche Bereiche angezeigt werden. Ohne Eintrag = alles sichtbar.
{KEYS.map(({ key, label }) => ( ))}
) }