MCPcopy
hub / github.com/claude-code-best/claude-code / AutoModeOptInDialog

Function AutoModeOptInDialog

src/components/AutoModeOptInDialog.tsx:18–79  ·  view source on GitHub ↗
({ onAccept, onDecline, declineExits }: Props)

Source from the content-addressed store, hash-verified

16};
17
18export function AutoModeOptInDialog({ onAccept, onDecline, declineExits }: Props): React.ReactNode {
19 React.useEffect(() => {
20 logEvent('tengu_auto_mode_opt_in_dialog_shown', {});
21 }, []);
22
23 function onChange(value: 'accept' | 'accept-default' | 'decline') {
24 switch (value) {
25 case 'accept': {
26 logEvent('tengu_auto_mode_opt_in_dialog_accept', {});
27 updateSettingsForSource('userSettings', {
28 skipAutoPermissionPrompt: true,
29 });
30 onAccept();
31 break;
32 }
33 case 'accept-default': {
34 logEvent('tengu_auto_mode_opt_in_dialog_accept_default', {});
35 updateSettingsForSource('userSettings', {
36 skipAutoPermissionPrompt: true,
37 permissions: { defaultMode: 'auto' },
38 });
39 onAccept();
40 break;
41 }
42 case 'decline': {
43 logEvent('tengu_auto_mode_opt_in_dialog_decline', {});
44 onDecline();
45 break;
46 }
47 }
48 }
49
50 return (
51 <Dialog title="Enable auto mode?" color="warning" onCancel={onDecline}>
52 <Box flexDirection="column" gap={1}>
53 <Text>{AUTO_MODE_DESCRIPTION}</Text>
54
55 <Link url="https://code.claude.com/docs/en/security" />
56 </Box>
57
58 <Select
59 options={[
60 ...((process.env.USER_TYPE as string) !== 'ant'
61 ? [
62 {
63 label: 'Yes, and make it my default mode',
64 value: 'accept-default' as const,
65 },
66 ]
67 : []),
68 { label: 'Yes, enable auto mode', value: 'accept' as const },
69 {
70 label: declineExits ? 'No, exit' : 'No, go back',
71 value: 'decline' as const,
72 },
73 ]}
74 onChange={value => onChange(value as 'accept' | 'accept-default' | 'decline')}
75 onCancel={onDecline}

Callers

nothing calls this directly

Calls 2

logEventFunction · 0.85
onChangeFunction · 0.70

Tested by

no test coverage detected