MCPcopy
hub / github.com/dabbott/react-native-express / FileTreeDiagram

Function FileTreeDiagram

components/FileTreeDiagram.tsx:16โ€“50  ยท  view source on GitHub โ†—
({ children }: Props)

Source from the content-addressed store, hash-verified

14}
15
16export default function FileTreeDiagram({ children }: Props) {
17 const root = children()
18
19 const output = diagram(root, {
20 getChildren: (node) => {
21 const normalized = normalizeNode(node)
22 return normalized.children ?? []
23 },
24 getLabel: (node) => {
25 const normalized = normalizeNode(node)
26 // return `${'children' in normalized ? '๐Ÿ“' : '๐Ÿ“„'} ${normalized.name}`
27 return normalized.name
28 },
29 type: 'directory',
30 flattenSingleChildNodes: false,
31 })
32
33 return (
34 <Pre
35 style={{
36 border: '1px solid rgba(0,0,0,0.05)',
37 padding: '16px 20px',
38 }}
39 >
40 <Code
41 style={{
42 lineHeight: '1.3',
43 fontSize: '14px',
44 }}
45 >
46 {output}
47 </Code>
48 </Pre>
49 )
50}

Callers

nothing calls this directly

Calls 1

normalizeNodeFunction ยท 0.85

Tested by

no test coverage detected