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.
83 lines
2.1 KiB
TypeScript
83 lines
2.1 KiB
TypeScript
import { usePage } from "@inertiajs/react";
|
|
import type { Icon } from "@tabler/icons-react";
|
|
import {
|
|
IconGridDots,
|
|
IconHelp,
|
|
IconMessageDots
|
|
} from "@tabler/icons-react";
|
|
import * as React from "react";
|
|
|
|
import AppLogoIcon from "@/components/app-logo-icon";
|
|
import { NavMain, type NavGroup, type NavItem } from "@/components/nav-main";
|
|
import { NavSecondary } from "@/components/nav-secondary";
|
|
import {
|
|
Sidebar,
|
|
SidebarContent,
|
|
SidebarHeader,
|
|
SidebarMenu,
|
|
SidebarMenuButton,
|
|
SidebarMenuItem,
|
|
} from "@/components/ui/sidebar";
|
|
import { index as academicTerm } from "@/routes/admin/master/academic-terms";
|
|
import { Calendar } from "lucide-react";
|
|
|
|
const data: { navMain: (NavGroup | NavItem)[]; navSecondary: { title: string; url: string; icon: Icon }[] } = {
|
|
navMain: [
|
|
{
|
|
name: "Dasbor",
|
|
url: "#",
|
|
icon: IconGridDots,
|
|
},
|
|
{
|
|
label: "Master",
|
|
items: [
|
|
{
|
|
name: "Periode Akademik",
|
|
url: academicTerm.url(),
|
|
icon: Calendar,
|
|
},
|
|
],
|
|
},
|
|
],
|
|
navSecondary: [
|
|
{
|
|
title: "Kritik dan Saran",
|
|
url: "#",
|
|
icon: IconMessageDots,
|
|
},
|
|
{
|
|
title: "Bantuan",
|
|
url: "#",
|
|
icon: IconHelp,
|
|
},
|
|
],
|
|
}
|
|
|
|
export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
|
|
const { name } = usePage().props;
|
|
|
|
return (
|
|
<Sidebar collapsible="icon" {...props}>
|
|
<SidebarHeader>
|
|
<SidebarMenu>
|
|
<SidebarMenuItem>
|
|
<SidebarMenuButton
|
|
asChild
|
|
className="data-[slot=sidebar-menu-button]:p-1.5!"
|
|
>
|
|
<a href="#">
|
|
<AppLogoIcon className="size-5! rounded-sm object-cover" />
|
|
<span className="text-base font-semibold">{name}</span>
|
|
</a>
|
|
</SidebarMenuButton>
|
|
</SidebarMenuItem>
|
|
</SidebarMenu>
|
|
</SidebarHeader>
|
|
<SidebarContent>
|
|
<NavMain items={data.navMain} />
|
|
<NavSecondary items={data.navSecondary} className="mt-auto" />
|
|
</SidebarContent>
|
|
</Sidebar>
|
|
)
|
|
}
|