diff --git a/resources/js/components/nav-main.tsx b/resources/js/components/nav-main.tsx index 12f1351..9cfa76d 100644 --- a/resources/js/components/nav-main.tsx +++ b/resources/js/components/nav-main.tsx @@ -1,70 +1,74 @@ -"use client" +'use client'; -import { Link, usePage } from "@inertiajs/react"; +import { Link, usePage } from '@inertiajs/react'; import { - SidebarGroup, - SidebarGroupLabel, - SidebarMenu, - SidebarMenuButton, - SidebarMenuItem -} from "@/components/ui/sidebar"; + SidebarGroup, + SidebarGroupLabel, + SidebarMenu, + SidebarMenuButton, + SidebarMenuItem, +} from '@/components/ui/sidebar'; export type NavItem = { - name: string - url: string - icon: React.ComponentType<{ className?: string }> -} + name: string; + url: string; + icon: React.ComponentType<{ className?: string }>; +}; export type NavGroup = { - label: string - items: NavItem[] -} - -export function NavMain({ - items, -}: { - items: (NavGroup | NavItem)[] -}) { - const { url } = usePage() - - return ( - <> - {items.map((item) => { - if ("label" in item) { - return ( - - {item.label} - - {item.items.map((child) => ( - - - - - {child.name} - - - - ))} - - - ) - } - - return ( - - - - - - - {item.name} - - - - - - ) - })} - - ) + label: string; + items: NavItem[]; +}; + +export function NavMain({ items }: { items: (NavGroup | NavItem)[] }) { + const { url } = usePage(); + + return ( + <> + {items.map((item) => { + if ('label' in item) { + return ( + + {item.label} + + {item.items.map((child) => ( + + + + + {child.name} + + + + ))} + + + ); + } + + return ( + + + + + + + {item.name} + + + + + + ); + })} + + ); } diff --git a/resources/js/components/nav-secondary.tsx b/resources/js/components/nav-secondary.tsx index c933b7f..7a929b7 100644 --- a/resources/js/components/nav-secondary.tsx +++ b/resources/js/components/nav-secondary.tsx @@ -1,42 +1,43 @@ -"use client" +'use client'; -import type {Icon} from "@tabler/icons-react"; -import * as React from "react" +import { Link } from '@inertiajs/react'; +import type { Icon } from '@tabler/icons-react'; +import * as React from 'react'; import { - SidebarGroup, - SidebarGroupContent, - SidebarMenu, - SidebarMenuButton, - SidebarMenuItem, -} from "@/components/ui/sidebar" + SidebarGroup, + SidebarGroupContent, + SidebarMenu, + SidebarMenuButton, + SidebarMenuItem, +} from '@/components/ui/sidebar'; export function NavSecondary({ - items, - ...props + items, + ...props }: { - items: { - title: string - url: string - icon: Icon - }[] + items: { + title: string; + url: string; + icon: Icon; + }[]; } & React.ComponentPropsWithoutRef) { - return ( - - - - {items.map((item) => ( - - - - - {item.title} - - - - ))} - - - - ) + return ( + + + + {items.map((item) => ( + + + + + {item.title} + + + + ))} + + + + ); } diff --git a/resources/js/pages/admin/academic-classes/assignments/submissions.tsx b/resources/js/pages/admin/academic-classes/assignments/submissions.tsx index af9e019..fbf5b63 100644 --- a/resources/js/pages/admin/academic-classes/assignments/submissions.tsx +++ b/resources/js/pages/admin/academic-classes/assignments/submissions.tsx @@ -1,4 +1,4 @@ -import { Head, router } from '@inertiajs/react'; +import { Head, Link, router } from '@inertiajs/react'; import type { ColumnDef } from '@tanstack/react-table'; import { format } from 'date-fns'; import { ArrowLeft, Pencil, Plus, Trash2 } from 'lucide-react'; @@ -161,10 +161,10 @@ export default function SubmissionIndex({ title="Pengumpulan Tugas" actions={ } /> diff --git a/resources/js/pages/admin/academic-classes/attendances/session.tsx b/resources/js/pages/admin/academic-classes/attendances/session.tsx index 781730d..3bd62a1 100644 --- a/resources/js/pages/admin/academic-classes/attendances/session.tsx +++ b/resources/js/pages/admin/academic-classes/attendances/session.tsx @@ -1,4 +1,4 @@ -import { Head, router } from '@inertiajs/react'; +import { Head, Link, router } from '@inertiajs/react'; import { format } from 'date-fns'; import { ArrowLeft, CheckCircle2, Save, XCircle } from 'lucide-react'; import { useState } from 'react'; @@ -86,10 +86,10 @@ export default function AttendanceSession({ title="Kehadiran" actions={ } /> diff --git a/resources/js/pages/admin/finances/tuition-invoices/payments.tsx b/resources/js/pages/admin/finances/tuition-invoices/payments.tsx index 67a5f94..cb81f3f 100644 --- a/resources/js/pages/admin/finances/tuition-invoices/payments.tsx +++ b/resources/js/pages/admin/finances/tuition-invoices/payments.tsx @@ -1,4 +1,4 @@ -import { Head, router } from '@inertiajs/react'; +import { Head, Link, router } from '@inertiajs/react'; import type { ColumnDef } from '@tanstack/react-table'; import { format } from 'date-fns'; import { ArrowLeft, Paperclip, Pencil, Plus, Trash2 } from 'lucide-react'; @@ -176,10 +176,10 @@ export default function TuitionPaymentIndex({ invoice, payments }: Props) { title="Pembayaran" actions={ } /> diff --git a/resources/js/pages/admin/manage/course-classes/enrollments.tsx b/resources/js/pages/admin/manage/course-classes/enrollments.tsx index fbf772c..8c7f857 100644 --- a/resources/js/pages/admin/manage/course-classes/enrollments.tsx +++ b/resources/js/pages/admin/manage/course-classes/enrollments.tsx @@ -1,4 +1,4 @@ -import { Head, router } from '@inertiajs/react'; +import { Head, Link, router } from '@inertiajs/react'; import type { ColumnDef } from '@tanstack/react-table'; import { format } from 'date-fns'; import { ArrowLeft, Trash2, UserPlus } from 'lucide-react'; @@ -109,10 +109,10 @@ export default function ClassEnrollmentIndex({ title="Peserta Kelas" actions={ } /> diff --git a/resources/js/pages/admin/users/administrators/create.tsx b/resources/js/pages/admin/users/administrators/create.tsx index f72dc82..c4ba2fa 100644 --- a/resources/js/pages/admin/users/administrators/create.tsx +++ b/resources/js/pages/admin/users/administrators/create.tsx @@ -1,4 +1,4 @@ -import { Form, Head } from '@inertiajs/react'; +import { Form, Head, Link } from '@inertiajs/react'; import { format } from 'date-fns'; import { ArrowLeft, Save } from 'lucide-react'; import { useState } from 'react'; @@ -7,7 +7,13 @@ import InputError from '@/components/input-error'; import { PageHeader } from '@/components/page-header'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; -import { Combobox, ComboboxContent, ComboboxInput, ComboboxItem, ComboboxList } from '@/components/ui/combobox'; +import { + Combobox, + ComboboxContent, + ComboboxInput, + ComboboxItem, + ComboboxList, +} from '@/components/ui/combobox'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { PhoneInput } from '@/components/ui/phone-input'; @@ -35,10 +41,10 @@ export default function AdministratorCreate({ roles }: Props) { title="Tambah Administrator" actions={ } /> @@ -53,29 +59,62 @@ export default function AdministratorCreate({ roles }: Props) {
- +
- +
- - setRole(v ?? '')}> - + + + setRole(v ?? '') + } + > + {roles.map((r) => ( - + {r.name} ))} @@ -94,57 +133,138 @@ export default function AdministratorCreate({ roles }: Props) {
- - + +
- - + +
- - + +
- - + +
- - + +
- +
- - + +
- - - + + +
-