43 lines
923 B
TypeScript
43 lines
923 B
TypeScript
'use client';
|
|
|
|
import type { Icon } from '@tabler/icons-react';
|
|
import * as React from 'react';
|
|
|
|
import {
|
|
SidebarGroup,
|
|
SidebarGroupContent,
|
|
SidebarMenu,
|
|
SidebarMenuButton,
|
|
SidebarMenuItem,
|
|
} from '@/components/ui/sidebar';
|
|
|
|
export function NavSecondary({
|
|
items,
|
|
...props
|
|
}: {
|
|
items: {
|
|
title: string;
|
|
url: string;
|
|
icon: Icon;
|
|
}[];
|
|
} & React.ComponentPropsWithoutRef<typeof SidebarGroup>) {
|
|
return (
|
|
<SidebarGroup {...props}>
|
|
<SidebarGroupContent>
|
|
<SidebarMenu>
|
|
{items.map(item => (
|
|
<SidebarMenuItem key={item.title}>
|
|
<SidebarMenuButton asChild>
|
|
<a href={item.url}>
|
|
<item.icon />
|
|
<span>{item.title}</span>
|
|
</a>
|
|
</SidebarMenuButton>
|
|
</SidebarMenuItem>
|
|
))}
|
|
</SidebarMenu>
|
|
</SidebarGroupContent>
|
|
</SidebarGroup>
|
|
);
|
|
}
|