| 15 | import './ConfigTree.css' |
| 16 | |
| 17 | export interface ConfigTreeProps<T extends ConfigItemBase> { |
| 18 | items: T[] |
| 19 | folders: ConfigFolder[] |
| 20 | selectedId: string | null |
| 21 | onSelect: (id: string | null) => void |
| 22 | itemIcon: React.ReactNode |
| 23 | itemNameKey: keyof T |
| 24 | isItem: (item: T | ConfigFolder) => item is T |
| 25 | batchUpdateItemsOrder: (items: (T | ConfigFolder)[], parentFolderId?: string) => void |
| 26 | createItem: (inFolderId?: string) => T |
| 27 | updateItem: (id: string, updates: Partial<T>) => void |
| 28 | deleteItem: (id: string) => void |
| 29 | copyItem?: (item: T) => T |
| 30 | createFolder: (name?: string, inFolderId?: string) => ConfigFolder |
| 31 | updateFolder: (id: string, updates: Partial<ConfigFolder>) => void |
| 32 | deleteFolder: (id: string) => void |
| 33 | clearFolder?: (id: string) => void |
| 34 | toggleFolderExpanded: (id: string) => void |
| 35 | defaultItemId?: string |
| 36 | emptyText?: string |
| 37 | addItemText?: string |
| 38 | createItemLabel?: string |
| 39 | createFolderLabel?: string |
| 40 | } |
| 41 | |
| 42 | export function ConfigTree<T extends ConfigItemBase>({ |
| 43 | items, |
nothing calls this directly
no outgoing calls
no test coverage detected