swarm ui: show thinking is a toggle of its own, apart from the developer details
This commit is contained in:
parent
2e9a65b414
commit
857b175a74
1 changed files with 243 additions and 25 deletions
|
|
@ -0,0 +1,24 @@
|
|||
// Settings-menu row: "show thinking". A `<SettingsMenu>` child, like
|
||||
// `HideDebugSetting`, and apart from it: thinking shows or hides on this row
|
||||
// alone, whatever "hide developer details" says. `../terminal/Row.tsx` follows
|
||||
// the preference as it changes.
|
||||
import { useState } from "preact/hooks";
|
||||
import { getShowThinkingPref, setShowThinkingPref } from "../prefs.js";
|
||||
|
||||
export function ShowThinkingSetting() {
|
||||
const [show, setShow] = useState(() => getShowThinkingPref());
|
||||
return (
|
||||
<label class="settings-menu-row">
|
||||
<span>show thinking</span>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={show}
|
||||
onChange={(e) => {
|
||||
const v = (e.target as HTMLInputElement).checked;
|
||||
setShowThinkingPref(v);
|
||||
setShow(v);
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue