import { BODY_HISTORY_VIZ_WIDGET_DEFAULTS, normalizeBodyHistoryVizConfig } from './bodyHistoryVizConfig' const CHART_TOGGLES = [ { key: 'show_weight_chart', label: 'Gewichts-Chart' }, { key: 'show_body_fat_chart', label: 'Körperfett (Caliper)' }, { key: 'show_proportion_chart', label: 'Silhouette & Proportion' }, { key: 'show_circumference_index_chart', label: 'Umfänge — Index' }, { key: 'show_circumference_lines_chart', label: 'Umfänge — Linien (Fallback)' }, ] const OTHER_TOGGLES = [ { key: 'show_goals_strip', label: 'Körper-Ziele (Strip)' }, { key: 'show_intro_blurb', label: 'Hinweistext unter Zielen' }, { key: 'show_layer_meta', label: 'Layer-2a-Hinweis (Meta)' }, { key: 'show_kpis', label: 'KPI-Kacheln' }, ] /** * @param {{ config: Record, onChange: (next: Record) => void }} props */ export default function BodyHistoryVizConfigEditor({ config, onChange }) { const merged = normalizeBodyHistoryVizConfig(config) const patch = (partial) => { const next = { ...merged, ...partial } const def = BODY_HISTORY_VIZ_WIDGET_DEFAULTS const stored = {} for (const k of Object.keys(def)) { if (next[k] !== def[k]) stored[k] = next[k] } onChange(stored) } const setBool = (key, checked) => { patch({ [key]: checked }) } return (
Körper (Verlauf-Bundle): welche Blöcke auf der Übersicht erscheinen. Unbelegte Felder = schlanker Standard (nur KPI kompakt + Gewicht).
KPI-Umfang
Bereiche
{OTHER_TOGGLES.map(({ key, label }) => ( ))}
Charts
{CHART_TOGGLES.map(({ key, label }) => ( ))}
) }