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

Function ApiKeyStep

src/commands/install-github-app/ApiKeyStep.tsx:18–230  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

16 onSelectOption?: (option: 'existing' | 'new' | 'oauth') => void;
17}
18export function ApiKeyStep(t0) {
19 const $ = _c(55);
20 const {
21 existingApiKey,
22 apiKeyOrOAuthToken,
23 onApiKeyChange,
24 onSubmit,
25 onToggleUseExistingKey,
26 onCreateOAuthToken,
27 selectedOption: t1,
28 onSelectOption
29 } = t0;
30 const selectedOption = t1 === undefined ? existingApiKey ? "existing" : onCreateOAuthToken ? "oauth" : "new" : t1;
31 const [cursorOffset, setCursorOffset] = useState(0);
32 const terminalSize = useTerminalSize();
33 const [theme] = useTheme();
34 let t2;
35 if ($[0] !== existingApiKey || $[1] !== onCreateOAuthToken || $[2] !== onSelectOption || $[3] !== onToggleUseExistingKey || $[4] !== selectedOption) {
36 t2 = () => {
37 if (selectedOption === "new" && onCreateOAuthToken) {
38 onSelectOption?.("oauth");
39 } else {
40 if (selectedOption === "oauth" && existingApiKey) {
41 onSelectOption?.("existing");
42 onToggleUseExistingKey(true);
43 }
44 }
45 };
46 $[0] = existingApiKey;
47 $[1] = onCreateOAuthToken;
48 $[2] = onSelectOption;
49 $[3] = onToggleUseExistingKey;
50 $[4] = selectedOption;
51 $[5] = t2;
52 } else {
53 t2 = $[5];
54 }
55 const handlePrevious = t2;
56 let t3;
57 if ($[6] !== onCreateOAuthToken || $[7] !== onSelectOption || $[8] !== onToggleUseExistingKey || $[9] !== selectedOption) {
58 t3 = () => {
59 if (selectedOption === "existing") {
60 onSelectOption?.(onCreateOAuthToken ? "oauth" : "new");
61 onToggleUseExistingKey(false);
62 } else {
63 if (selectedOption === "oauth") {
64 onSelectOption?.("new");
65 }
66 }
67 };
68 $[6] = onCreateOAuthToken;
69 $[7] = onSelectOption;
70 $[8] = onToggleUseExistingKey;
71 $[9] = selectedOption;
72 $[10] = t3;
73 } else {
74 t3 = $[10];
75 }

Callers

nothing calls this directly

Calls 5

useTerminalSizeFunction · 0.85
onSubmitFunction · 0.85
useKeybindingsFunction · 0.85
colorFunction · 0.85
useThemeFunction · 0.50

Tested by

no test coverage detected