si-klinik/sk-klinik.my.id/resources/views/layouts/app/sidebar.blade.php

212 lines
9.4 KiB
PHP

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="dark">
<head>
@include('partials.head')
</head>
<body class="bg-white dark:bg-zinc-800 min-h-screen">
<flux:sidebar sticky collapsible="mobile"
class="bg-zinc-50 dark:bg-zinc-900 border-e border-zinc-200 dark:border-zinc-700">
<flux:sidebar.header>
<x-app-logo :sidebar="true" href="{{ route('dashboard') }}" wire:navigate />
<flux:sidebar.collapse class="lg:hidden" />
</flux:sidebar.header>
<flux:sidebar.nav>
{{-- GROUP: PLATFORM --}}
<flux:sidebar.group :heading="__('Platform')" class="grid">
{{-- Dashboard: Biasanya semua user (Admin/Patient) punya akses --}}
@can('view-dashboard')
<flux:sidebar.item icon="home" :href="route('dashboard')" :current="request()->routeIs('dashboard')"
wire:navigate>
{{ __('Dashboard') }}
</flux:sidebar.item>
@endcan
{{-- MENU GUEST: Khusus user baru yang belum melengkapi data --}}
@hasrole('guest')
<flux:sidebar.item icon="user-plus" :href="route('guest.complete-profile')"
:current="request()->routeIs('guest.complete-profile')" wire:navigate>
{{ __('Profil Pengunjung') }}
</flux:sidebar.item>
@endhasrole
{{-- MENU PATIENT: Kita kembalikan ke @hasrole agar khusus untuk pasien saja --}}
@hasrole('patient')
<flux:sidebar.item icon="home" :href="route('dashboard')" :current="request()->routeIs('dashboard')"
wire:navigate>
{{ __('Dashboard') }}
</flux:sidebar.item>
<flux:sidebar.item icon="user" :href="route('patient.profile')"
:current="request()->routeIs('patient.profile*')" wire:navigate>
{{ __('Profil Saya') }}
</flux:sidebar.item>
<flux:sidebar.item icon="queue-list" :href="route('patient.appointment')"
:current="request()->routeIs('patient.appointment*')" wire:navigate>
{{ __('Booking & Monitor Antrean') }}
</flux:sidebar.item>
<flux:sidebar.item icon="newspaper" :href="route('patient.news')"
:current="request()->routeIs('patient.news*')" wire:navigate>
{{ __('Informasi') }}
</flux:sidebar.item>
@endhasrole
</flux:sidebar.group>
{{-- ===================== --}}
{{-- MANAJEMEN KLINIK (ADMIN/STAFF) --}}
{{-- ===================== --}}
{{-- Di sini kita pakai @can karena Admin & Staff bisa berbagi tugas --}}
@if (auth()->user()->canany(['doctor-manage', 'patient-manage', 'antrean-manage', 'service-manage']))
<flux:sidebar.group heading="Manajemen Klinik" class="grid">
@can('doctor-manage')
<flux:sidebar.item icon="user" :href="route('admin.doctors')"
:current="request()->routeIs('admin.doctors')" wire:navigate>
Kelola Dokter
</flux:sidebar.item>
@endcan
@can('patient-manage')
<flux:sidebar.item icon="users" :href="route('admin.patients')"
:current="request()->routeIs('admin.patients')" wire:navigate>
Kelola Pasien
</flux:sidebar.item>
@endcan
@can('antrean-manage')
<flux:sidebar.item icon="queue-list" :href="route('admin.antrean')"
:current="request()->routeIs('admin.antrean')" wire:navigate>
Kelola Antrean
</flux:sidebar.item>
@endcan
@can('service-manage')
<flux:sidebar.item icon="heart" :href="route('admin.services')"
:current="request()->routeIs('admin.services')" wire:navigate>
Kelola Layanan
</flux:sidebar.item>
@endcan
</flux:sidebar.group>
@endif
{{-- ===================== --}}
{{-- INFORMASI --}}
{{-- ===================== --}}
@if (auth()->user()->canany(['category-manage', 'news-manage']))
<flux:sidebar.group expandable :expanded="true" heading="Informasi" class="grid">
@can('category-manage')
<flux:sidebar.item icon="tag" :href="route('admin.categories')"
:current="request()->routeIs('admin.categories')" wire:navigate>
Kategori Berita
</flux:sidebar.item>
@endcan
@can('news-manage')
<flux:sidebar.item icon="newspaper" :href="route('admin.news')"
:current="request()->routeIs('admin.news')" wire:navigate>
Daftar Berita
</flux:sidebar.item>
@endcan
</flux:sidebar.group>
@endif
{{-- ===================== --}}
{{-- MASTER DATA --}}
{{-- ===================== --}}
@if (auth()->user()->canany(['settings-manage', 'role-manage', 'user-manage']))
<flux:sidebar.group expandable heading="Master Data" class="grid">
@can('settings-manage')
<flux:sidebar.item icon="wrench" :href="route('admin.settings')"
:current="request()->routeIs('admin.settings')" wire:navigate>
Pengaturan Sistem
</flux:sidebar.item>
@endcan
@can('role-manage')
<flux:sidebar.item icon="shield-check" :href="route('admin.roles')"
:current="request()->routeIs('admin.roles')" wire:navigate>
Manajemen Role
</flux:sidebar.item>
@endcan
@can('user-manage')
<flux:sidebar.item icon="users" :href="route('admin.users')"
:current="request()->routeIs('admin.users')" wire:navigate>
Manajemen Pengguna
</flux:sidebar.item>
@endcan
</flux:sidebar.group>
@endif
</flux:sidebar.nav>
<flux:spacer />
{{--
<flux:sidebar.nav>
<flux:sidebar.item icon="folder-git-2" href="https://github.com/laravel/livewire-starter-kit" target="_blank">
{{ __('Repository') }}
</flux:sidebar.item>
<flux:sidebar.item icon="book-open-text" href="https://laravel.com/docs/starter-kits#livewire" target="_blank">
{{ __('Documentation') }}
</flux:sidebar.item>
</flux:sidebar.nav> --}}
<x-desktop-user-menu class="hidden lg:block" :name="auth()->user()->name" />
</flux:sidebar>
<!-- Mobile User Menu -->
<flux:header class="lg:hidden">
<flux:sidebar.toggle class="lg:hidden" icon="bars-2" inset="left" />
<flux:spacer />
<flux:dropdown position="top" align="end">
<flux:profile :initials="auth()->user()->initials()" icon-trailing="chevron-down" />
<flux:menu>
<flux:menu.radio.group>
<div class="p-0 font-normal text-sm">
<div class="flex items-center gap-2 px-1 py-1.5 text-sm text-start">
<flux:avatar :name="auth()->user()->name" :initials="auth()->user()->initials()" />
<div class="flex-1 grid text-sm text-start leading-tight">
<flux:heading class="truncate">{{ auth()->user()->name }}</flux:heading>
<flux:text class="truncate">{{ auth()->user()->email }}</flux:text>
</div>
</div>
</div>
</flux:menu.radio.group>
<flux:menu.separator />
<flux:menu.radio.group>
<flux:menu.item :href="route('profile.edit')" icon="cog" wire:navigate>
{{ __('Settings') }}
</flux:menu.item>
</flux:menu.radio.group>
<flux:menu.separator />
<form method="POST" action="{{ route('logout') }}" class="w-full">
@csrf
<flux:menu.item as="button" type="submit" icon="arrow-right-start-on-rectangle"
class="w-full cursor-pointer" data-test="logout-button">
{{ __('Log out') }}
</flux:menu.item>
</form>
</flux:menu>
</flux:dropdown>
</flux:header>
{{ $slot }}
<x-toaster-hub />
@fluxScripts
</body>
</html>