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

Function FastModePicker

src/commands/fast/fast.tsx:41–210  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

39 }
40}
41export function FastModePicker(t0) {
42 const $ = _c(30);
43 const {
44 onDone,
45 unavailableReason
46 } = t0;
47 const model = useAppState(_temp);
48 const initialFastMode = useAppState(_temp2);
49 const setAppState = useSetAppState();
50 const [enableFastMode, setEnableFastMode] = useState(initialFastMode ?? false);
51 let t1;
52 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
53 t1 = getFastModeRuntimeState();
54 $[0] = t1;
55 } else {
56 t1 = $[0];
57 }
58 const runtimeState = t1;
59 const isCooldown = runtimeState.status === "cooldown";
60 const isUnavailable = unavailableReason !== null;
61 let t2;
62 if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
63 t2 = formatModelPricing(getOpus46CostTier(true));
64 $[1] = t2;
65 } else {
66 t2 = $[1];
67 }
68 const pricing = t2;
69 let t3;
70 if ($[2] !== enableFastMode || $[3] !== isUnavailable || $[4] !== model || $[5] !== onDone || $[6] !== setAppState) {
71 t3 = function handleConfirm() {
72 if (isUnavailable) {
73 return;
74 }
75 applyFastMode(enableFastMode, setAppState);
76 logEvent("tengu_fast_mode_toggled", {
77 enabled: enableFastMode,
78 source: "picker" as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS
79 });
80 if (enableFastMode) {
81 const fastIcon = getFastIconString(enableFastMode);
82 const modelUpdated = !isFastModeSupportedByModel(model) ? ` · model set to ${FAST_MODE_MODEL_DISPLAY}` : "";
83 onDone(`${fastIcon} Fast mode ON${modelUpdated} · ${pricing}`);
84 } else {
85 setAppState(_temp3);
86 onDone("Fast mode OFF");
87 }
88 };
89 $[2] = enableFastMode;
90 $[3] = isUnavailable;
91 $[4] = model;
92 $[5] = onDone;
93 $[6] = setAppState;
94 $[7] = t3;
95 } else {
96 t3 = $[7];
97 }
98 const handleConfirm = t3;

Callers

nothing calls this directly

Calls 12

useAppStateFunction · 0.85
useSetAppStateFunction · 0.85
getFastModeRuntimeStateFunction · 0.85
formatModelPricingFunction · 0.85
getOpus46CostTierFunction · 0.85
applyFastModeFunction · 0.85
logEventFunction · 0.85
getFastIconStringFunction · 0.85
useKeybindingsFunction · 0.85
onDoneFunction · 0.50
formatDurationFunction · 0.50

Tested by

no test coverage detected