/* global React */

// minimal stub for the tweak panel hooks/components referenced by dashboard-app.
// Keeps the same API shape but renders nothing — settings are persisted in localStorage.

window.useTweaks = function (defaults) {
  const key = "triade.tweaks.v1";
  const initial = React.useMemo(() => {
    try {
      const stored = JSON.parse(localStorage.getItem(key) || "null");
      return { ...defaults, ...(stored || {}) };
    } catch { return defaults; }
  }, []);
  const [t, setT] = React.useState(initial);
  const setTweak = React.useCallback((k, v) => {
    setT(prev => {
      const next = { ...prev, [k]: v };
      try { localStorage.setItem(key, JSON.stringify(next)); } catch {}
      return next;
    });
  }, []);
  return [t, setTweak];
};

window.TweaksPanel  = function () { return null; };
window.TweakSection = function () { return null; };
window.TweakRadio   = function () { return null; };
window.TweakToggle  = function () { return null; };
