mirror of
https://github.com/supabase/supabase.git
synced 2026-10-17 15:19:08 +03:00
* Add all missing libraries in the packages/apps. * Add all missing Vitest imports to the tests. * Add some missing exports to ui. * Fix the admonition export. * Fix various minor bugs. * Migrate the ui package to use vitest.
44 lines
883 B
TypeScript
44 lines
883 B
TypeScript
import { TreeView, TreeViewItem, flattenTree } from 'ui'
|
|
|
|
export default function TreeViewDemo() {
|
|
const data = {
|
|
name: '',
|
|
children: [
|
|
{
|
|
name: 'Current batch',
|
|
},
|
|
{
|
|
name: 'Older queries',
|
|
},
|
|
{
|
|
name: 'query all users',
|
|
},
|
|
{
|
|
name: 'users in last day',
|
|
},
|
|
{
|
|
name: 'new users over time',
|
|
},
|
|
],
|
|
}
|
|
|
|
return (
|
|
<TreeView
|
|
data={flattenTree(data)}
|
|
aria-label="directory tree"
|
|
className="w-[420px]"
|
|
nodeRenderer={({ element, isBranch, isExpanded, getNodeProps, level, isSelected }) => (
|
|
<TreeViewItem
|
|
isExpanded={isExpanded}
|
|
isBranch={isBranch}
|
|
isSelected={isSelected}
|
|
level={level}
|
|
xPadding={16}
|
|
name={element.name}
|
|
{...getNodeProps()}
|
|
/>
|
|
)}
|
|
/>
|
|
)
|
|
}
|