Files
NextChair/resources/views/staff/dashboard.blade.php
T
Stefan Lazic 2ef3654841
CI / ci (push) Canceled after 0s
PHP Rebuild
Initial PHP rebuild of the app
2026-09-05 08:21:33 +01:00

18 lines
6.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<x-layouts.staff :business="$business">
@if ($isOwner)
@php($totalVisits = $appointments->count())
@php($confirmed = $appointments->where('status.value', 'CONFIRMED')->count())
<div class="min-h-screen bg-stone pb-32 text-ink">
<header class="fixed left-0 right-0 top-0 z-50 flex items-center justify-between border-b border-line bg-white/80 px-6 py-6 backdrop-blur-md"><a href="{{ route('public.home') }}" class="flex h-10 w-10 items-center justify-center rounded-full border border-line"><i class="fa-solid fa-arrow-left text-sm"></i></a><h1 class="text-lg font-bold tracking-tight">Business Dashboard</h1><form method="POST" action="{{ route('auth.signout') }}">@csrf<button class="flex h-10 w-10 items-center justify-center rounded-full border border-line"><i class="fa-solid fa-right-from-bracket text-sm"></i></button></form></header>
<main class="mx-auto mt-24 max-w-md space-y-8 px-6"><section class="grid grid-cols-2 gap-3"><div class="rounded-jumbo border border-line bg-white p-5 shadow-sm"><span class="mb-1 block text-[10px] font-bold uppercase tracking-widest text-muted">Total visits</span><p class="text-2xl font-bold">{{ $totalVisits }}</p><span class="text-[8px] font-bold text-accent">Today</span></div><div class="rounded-jumbo border border-line bg-white p-5 shadow-sm"><span class="mb-1 block text-[10px] font-bold uppercase tracking-widest text-muted">Confirmed</span><p class="text-2xl font-bold">{{ $confirmed }}</p><span class="text-[8px] font-bold text-accent">Today</span></div></section>
<section><h3 class="mb-4 ml-1 text-[10px] font-bold uppercase tracking-widest text-muted">Top services</h3><div class="overflow-hidden rounded-jumbo border border-line bg-white">@php($serviceCounts = $appointments->flatMap->services->groupBy('service.name')->map->count()->sortDesc()->take(3)) @forelse ($serviceCounts as $name => $count)<div class="flex items-center justify-between border-b border-line px-6 py-4 last:border-0"><span class="text-sm font-bold">{{ $name }}</span><span class="text-xs text-muted">{{ $count }} visit{{ $count === 1 ? '' : 's' }}</span></div>@empty<div class="px-6 py-4 text-sm text-muted">Your most popular services will appear here.</div>@endforelse</div></section>
<section><div class="mb-4 flex items-end justify-between px-1"><h3 class="text-[10px] font-bold uppercase tracking-widest text-muted">Staff performance</h3><a href="{{ route('owner.team') }}" class="border-b border-ink text-[10px] font-bold uppercase tracking-widest">Manage team</a></div><div class="space-y-3">@forelse ($business->staff->where('status.value', 'ACTIVE')->take(4) as $member)<div class="flex items-center gap-4 rounded-jumbo border border-line bg-white p-4"><div class="flex h-10 w-10 items-center justify-center rounded-full bg-stone"><i class="fa-solid fa-user"></i></div><div class="flex-1"><p class="text-sm font-bold">{{ $member->user?->name ?: 'Team member' }}</p><div class="mt-2 h-1.5 w-full overflow-hidden rounded-full bg-stone"><div class="h-full w-4/5 bg-accent"></div></div></div><span class="text-xs font-bold">{{ $member->user?->name ? 'Active' : '—' }}</span></div>@empty<p class="text-sm text-muted">Add team members to see performance.</p>@endforelse</div></section>
<section class="rounded-jumbo bg-ink p-6 text-white"><h3 class="mb-2 text-lg font-bold">Booking rules</h3><p class="mb-6 text-xs text-white/60">Manage cancellation policies, booking windows, and lead times.</p><a href="{{ route('owner.booking-rules') }}" class="block w-full rounded-xl bg-white py-3 text-center text-xs font-bold uppercase tracking-widest text-ink">Update rules</a></section>
</main>
<nav class="fixed bottom-0 left-0 right-0 z-50 flex items-center justify-between border-t border-white/5 bg-[#0c0c0c] px-10 py-4 text-gray-400"><a href="{{ route('staff.dashboard') }}" class="flex flex-col items-center gap-1 text-white"><i class="fa-solid fa-calendar-days text-xl"></i><span class="text-[10px] font-medium">Calendar</span></a><a href="{{ route('staff.dashboard') }}" class="flex flex-col items-center gap-1"><i class="fa-solid fa-scissors text-xl"></i><span class="text-[10px] font-medium">Current</span></a><a href="{{ route('owner.team') }}" class="flex flex-col items-center gap-1"><i class="fa-solid fa-users text-xl"></i><span class="text-[10px] font-medium">Clients</span></a><a href="{{ route('owner.business') }}" class="flex flex-col items-center gap-1"><i class="fa-solid fa-gear text-xl"></i><span class="text-[10px] font-medium">Settings</span></a></nav>
</div>
@else
<div class="mx-auto min-h-screen max-w-7xl px-5 py-8 text-white sm:px-8 lg:px-12 lg:py-12"><header class="flex items-start justify-between gap-5"><div><p class="text-[10px] font-bold uppercase tracking-[0.3em] text-accent">Staff workspace</p><h1 class="mt-3 text-4xl font-black tracking-tight">Good morning, {{ $staff->user?->name ?: 'there' }}</h1><p class="mt-2 text-sm text-white/60">{{ now($business->timezone)->format('l, j F Y') }}</p></div><form method="POST" action="{{ route('auth.signout') }}">@csrf<button class="rounded-full px-4 py-2 text-xs font-bold uppercase tracking-widest text-white/70 hover:bg-white/10">Sign out</button></form></header><section class="mt-10 grid gap-3 sm:grid-cols-3"><div class="rounded-jumbo bg-white/10 p-5"><p class="text-xs text-white/50">Today’s appointments</p><p class="mt-3 text-3xl font-black">{{ $appointments->count() }}</p></div><div class="rounded-jumbo bg-white/10 p-5"><p class="text-xs text-white/50">Confirmed</p><p class="mt-3 text-3xl font-black">{{ $appointments->where('status.value', 'CONFIRMED')->count() }}</p></div><div class="rounded-jumbo bg-accent p-5 text-ink"><p class="text-xs text-ink/60">Next appointment</p><p class="mt-3 text-lg font-black">{{ $appointments->first()?->startAt->setTimezone($business->timezone)->format('g:i A') ?: 'None yet' }}</p></div></section><section class="mt-10"><h2 class="text-xl font-bold">Today’s schedule</h2><div class="mt-5 space-y-3">@forelse ($appointments as $appointment)<article class="flex flex-col justify-between gap-4 rounded-jumbo bg-white p-5 text-ink sm:flex-row sm:items-center"><div><p class="text-sm font-bold">{{ $appointment->startAt->setTimezone($business->timezone)->format('g:i A') }} · {{ $appointment->customer->firstName }} {{ $appointment->customer->lastName }}</p><p class="mt-2 text-sm text-muted">{{ $appointment->services->pluck('service.name')->join(', ') }}</p></div><span class="rounded-full bg-stone px-3 py-1 text-[10px] font-bold uppercase tracking-widest text-muted">{{ ucfirst(strtolower($appointment->status->value)) }}</span></article>@empty<div class="rounded-jumbo border border-white/10 p-8 text-center text-sm text-white/60">Your schedule is clear today.</div>@endforelse</div></section></div>
@endif
</x-layouts.staff>