/* Stub tweaks panel — brak oryginalnego pliku w paczce. Zwraca defaults i no-op UI. */
console.log("[stub] tweaks-panel.jsx evaluated");
function useTweaks(defaults) {
  const [tweaks, setTweaks] = React.useState(defaults || {});
  // useCallback ze stałą referencją — bez tego setTweak rekreowany na każdy render
  // psuje useEffect deps w PrzelomOS i wywołuje infinite re-run (12k+ Maximum update depth).
  const setTweak = React.useCallback((key, value) => {
    if (typeof key === "object") {
      setTweaks((prev) => ({ ...prev, ...key }));
      return;
    }
    setTweaks((prev) => ({ ...prev, [key]: value }));
  }, []);
  return [tweaks, setTweak];
}
function TweaksPanel({ title, onClose, children }) {
  return (
    <div
      style={{
        position: "fixed",
        top: 20,
        right: 20,
        zIndex: 9999,
        background: "#111",
        color: "#caff33",
        border: "1px solid #caff33",
        padding: 12,
        fontFamily: "JetBrains Mono, monospace",
        fontSize: 12,
        maxWidth: 320,
      }}
    >
      <div
        style={{
          display: "flex",
          justifyContent: "space-between",
          marginBottom: 8,
        }}
      >
        <strong>{title || "Tweaks"}</strong>
        <button
          onClick={onClose}
          style={{
            background: "none",
            border: "none",
            color: "#caff33",
            cursor: "pointer",
          }}
        >
          ✕
        </button>
      </div>
      <div style={{ opacity: 0.6, marginBottom: 8 }}>
        panel stub — brak tweaks-panel.jsx w paczce
      </div>
      {children}
    </div>
  );
}
const TweakSection = ({ title, children }) => (
  <div style={{ marginTop: 8 }}>
    <div style={{ opacity: 0.7 }}>{title}</div>
    {children}
  </div>
);
const TweakColor = () => null;
const TweakSlider = () => null;
const TweakRadio = () => null;
const TweakSelect = () => null;
window.useTweaks = useTweaks;
window.TweaksPanel = TweaksPanel;
window.TweakSection = TweakSection;
window.TweakColor = TweakColor;
window.TweakSlider = TweakSlider;
window.TweakRadio = TweakRadio;
window.TweakSelect = TweakSelect;
