(path: string)
| 2 | const expanded = useState<Set<string>>(`npmx-file-tree${baseUrl}`, () => new Set<string>()) |
| 3 | |
| 4 | function toggleDir(path: string) { |
| 5 | if (expanded.value.has(path)) { |
| 6 | expanded.value.delete(path) |
| 7 | } else { |
| 8 | expanded.value.add(path) |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | function isExpanded(path: string) { |
| 13 | return expanded.value.has(path) |