| import { Sidebar, SidebarContent, SidebarFooter, SidebarRail } from '@/components/ui/sidebar'; | |
| import { NavGroup } from '@/components/layout/nav-group'; | |
| import { NavUser } from '@/components/layout/nav-user'; | |
| import { SidebarData } from './types'; | |
| type IProps = React.ComponentProps<typeof Sidebar> & { | |
| sidebarData: SidebarData; | |
| }; | |
| export function AppSidebar({ sidebarData, ...props }: IProps) { | |
| return ( | |
| <Sidebar collapsible='icon' variant='floating' {...props}> | |
| <SidebarContent> | |
| {sidebarData.navGroups.map((props) => ( | |
| <NavGroup key={props.title} {...props} /> | |
| ))} | |
| </SidebarContent> | |
| <SidebarFooter> | |
| <NavUser user={sidebarData.user} /> | |
| </SidebarFooter> | |
| <SidebarRail /> | |
| </Sidebar> | |
| ); | |
| } | |