MCPcopy
hub / github.com/codeaashu/claude-code / Settings

Function Settings

src/components/Settings/Settings.tsx:22–130  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

20 defaultTab: 'Status' | 'Config' | 'Usage' | 'Gates';
21};
22export function Settings(t0) {
23 const $ = _c(25);
24 const {
25 onClose,
26 context,
27 defaultTab
28 } = t0;
29 const [selectedTab, setSelectedTab] = useState(defaultTab);
30 const [tabsHidden, setTabsHidden] = useState(false);
31 const [configOwnsEsc, setConfigOwnsEsc] = useState(false);
32 const [gatesOwnsEsc, setGatesOwnsEsc] = useState(false);
33 const insideModal = useIsInsideModal();
34 const {
35 rows
36 } = useModalOrTerminalSize(useTerminalSize());
37 const contentHeight = insideModal ? rows + 1 : Math.max(15, Math.min(Math.floor(rows * 0.8), 30));
38 const [diagnosticsPromise] = useState(_temp2);
39 useExitOnCtrlCDWithKeybindings();
40 let t1;
41 if ($[0] !== onClose || $[1] !== tabsHidden) {
42 t1 = () => {
43 if (tabsHidden) {
44 return;
45 }
46 onClose("Status dialog dismissed", {
47 display: "system"
48 });
49 };
50 $[0] = onClose;
51 $[1] = tabsHidden;
52 $[2] = t1;
53 } else {
54 t1 = $[2];
55 }
56 const handleEscape = t1;
57 const t2 = !tabsHidden && !(selectedTab === "Config" && configOwnsEsc) && !(selectedTab === "Gates" && gatesOwnsEsc);
58 let t3;
59 if ($[3] !== t2) {
60 t3 = {
61 context: "Settings",
62 isActive: t2
63 };
64 $[3] = t2;
65 $[4] = t3;
66 } else {
67 t3 = $[4];
68 }
69 useKeybinding("confirm:no", handleEscape, t3);
70 let t4;
71 if ($[5] !== context || $[6] !== diagnosticsPromise) {
72 t4 = <Tab key="status" title="Status"><Status context={context} diagnosticsPromise={diagnosticsPromise} /></Tab>;
73 $[5] = context;
74 $[6] = diagnosticsPromise;
75 $[7] = t4;
76 } else {
77 t4 = $[7];
78 }
79 let t5;

Callers

nothing calls this directly

Calls 6

useIsInsideModalFunction · 0.85
useModalOrTerminalSizeFunction · 0.85
useTerminalSizeFunction · 0.85
useKeybindingFunction · 0.85
maxMethod · 0.80

Tested by

no test coverage detected