Some checks failed
tests / ci (pull_request) Has been cancelled
- Added Semester enum with labels for odd and even semesters. - Created AcademicTerm model, controller, service, and request for handling academic terms. - Implemented paginated listing, creation, updating, and deletion of academic terms. - Added routes for academic terms management under admin/master. - Created frontend components for displaying and managing academic terms, including forms and data tables. - Integrated confirmation dialog for delete actions and form dialogs for creating and editing academic terms. - Added seeder for initial academic term data.
69 lines
1.7 KiB
TypeScript
69 lines
1.7 KiB
TypeScript
"use client"
|
|
|
|
import {
|
|
SidebarGroup,
|
|
SidebarGroupLabel,
|
|
SidebarMenu,
|
|
SidebarMenuButton,
|
|
SidebarMenuItem
|
|
} from "@/components/ui/sidebar";
|
|
|
|
export type NavItem = {
|
|
name: string
|
|
url: string
|
|
icon: React.ComponentType<{ className?: string }>
|
|
}
|
|
|
|
export type NavGroup = {
|
|
label: string
|
|
items: NavItem[]
|
|
}
|
|
|
|
export function NavMain({
|
|
items,
|
|
}: {
|
|
items: (NavGroup | NavItem)[]
|
|
}) {
|
|
|
|
return (
|
|
<>
|
|
{items.map((item, index) => {
|
|
if ("label" in item) {
|
|
return (
|
|
<SidebarGroup key={item.label} className="group-data-[collapsible=icon]:hidden">
|
|
<SidebarGroupLabel>{item.label}</SidebarGroupLabel>
|
|
<SidebarMenu>
|
|
{item.items.map((child) => (
|
|
<SidebarMenuItem key={child.name}>
|
|
<SidebarMenuButton asChild>
|
|
<a href={child.url}>
|
|
<child.icon className="h-4 w-4" />
|
|
<span>{child.name}</span>
|
|
</a>
|
|
</SidebarMenuButton>
|
|
</SidebarMenuItem>
|
|
))}
|
|
</SidebarMenu>
|
|
</SidebarGroup>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<SidebarGroup key={item.name} className="group-data-[collapsible=icon]:hidden">
|
|
<SidebarMenu>
|
|
<SidebarMenuItem>
|
|
<SidebarMenuButton asChild>
|
|
<a href={item.url}>
|
|
<item.icon className="h-4 w-4" />
|
|
<span>{item.name}</span>
|
|
</a>
|
|
</SidebarMenuButton>
|
|
</SidebarMenuItem>
|
|
</SidebarMenu>
|
|
</SidebarGroup>
|
|
)
|
|
})}
|
|
</>
|
|
)
|
|
}
|