/* Tweaks for the Engineering Excellence wireframe.
   Applies structural variations by setting data-* on <html>;
   styles.css + dashboard.js react to those attributes. */

const EE_TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
  "density": "comfortable",
  "summary": true,
  "sprint": "scrubber",
  "drill": "expand",
  "color": "full",
  "sketch": "rough"
}/*EDITMODE-END*/;

function EETweaks(){
  const [t, setTweak] = useTweaks(EE_TWEAK_DEFAULTS);

  React.useEffect(()=>{
    const d = document.documentElement.dataset;
    d.density = t.density;
    d.summary = t.summary ? 'on' : 'off';
    d.sprint  = t.sprint;
    d.drill   = t.drill;
    d.color   = t.color;
    d.sketch  = t.sketch;
  }, [t]);

  return (
    <TweaksPanel title="Tweaks">
      <TweakSection label="Layout" />
      <TweakRadio label="Card density" value={t.density}
        options={['comfortable','compact']}
        onChange={(v)=>setTweak('density', v)} />
      <TweakToggle label="Summary strip" value={t.summary}
        onChange={(v)=>setTweak('summary', v)} />
      <TweakRadio label="Month control" value={t.sprint}
        options={['scrubber','dropdown']}
        onChange={(v)=>setTweak('sprint', v)} />

      <TweakSection label="Drill-down" />
      <TweakRadio label="Open detail as" value={t.drill}
        options={['expand','modal']}
        onChange={(v)=>setTweak('drill', v)} />

      <TweakSection label="Sketch style" />
      <TweakRadio label="Color" value={t.color}
        options={['full','mono']}
        onChange={(v)=>setTweak('color', v)} />
      <TweakRadio label="Linework" value={t.sketch}
        options={['rough','clean']}
        onChange={(v)=>setTweak('sketch', v)} />
    </TweaksPanel>
  );
}

ReactDOM.createRoot(document.getElementById('tweaks-root')).render(<EETweaks />);
