MCPcopy Create free account
hub / github.com/anus-dev/ANUS / FolderTrustDialog

Function FolderTrustDialog

packages/cli/src/ui/components/FolderTrustDialog.tsx:27–75  ·  view source on GitHub ↗
({
  onSelect,
})

Source from the content-addressed store, hash-verified

25}
26
27export const FolderTrustDialog: React.FC<FolderTrustDialogProps> = ({
28 onSelect,
29}) => {
30 useKeypress(
31 (key) => {
32 if (key.name === 'escape') {
33 onSelect(FolderTrustChoice.DO_NOT_TRUST);
34 }
35 },
36 { isActive: true },
37 );
38
39 const options: Array<RadioSelectItem<FolderTrustChoice>> = [
40 {
41 label: 'Trust folder',
42 value: FolderTrustChoice.TRUST_FOLDER,
43 },
44 {
45 label: 'Trust parent folder',
46 value: FolderTrustChoice.TRUST_PARENT,
47 },
48 {
49 label: "Don't trust (esc)",
50 value: FolderTrustChoice.DO_NOT_TRUST,
51 },
52 ];
53
54 return (
55 <Box
56 flexDirection="column"
57 borderStyle="round"
58 borderColor={Colors.AccentYellow}
59 padding={1}
60 width="100%"
61 marginLeft={1}
62 >
63 <Box flexDirection="column" marginBottom={1}>
64 <Text bold>Do you trust this folder?</Text>
65 <Text>
66 Trusting a folder allows Anus to execute commands it suggests. This is
67 a security feature to prevent accidental execution in untrusted
68 directories.
69 </Text>
70 </Box>
71
72 <RadioButtonSelect items={options} onSelect={onSelect} isFocused />
73 </Box>
74 );
75};

Callers

nothing calls this directly

Calls 1

useKeypressFunction · 0.85

Tested by

no test coverage detected