Deploy Ladill Frontdesk / deploy (push) Successful in 55s
Add warning, danger, and link button styles plus x-btn and x-danger-zone components so ghost text actions match the primary pill UI across edit screens and tables. Co-authored-by: Cursor <cursoragent@cursor.com>
66 lines
3.9 KiB
PHP
66 lines
3.9 KiB
PHP
<x-app-layout title="Visit history">
|
|
<div class="space-y-6">
|
|
<x-frontdesk.page-hero
|
|
badge="Check-in · Badges · Visit history"
|
|
title="Visits"
|
|
description="Track visitor arrivals, scheduled appointments, and on-site activity across your locations."
|
|
:stats="[
|
|
['value' => number_format($heroStats['on_site']), 'label' => 'On site now'],
|
|
['value' => number_format($heroStats['today']), 'label' => 'Checked in today'],
|
|
['value' => number_format($heroStats['total']), 'label' => 'All visits'],
|
|
]">
|
|
<x-slot name="actions">
|
|
<a href="{{ route('frontdesk.visits.schedule') }}" class="btn-secondary">Schedule visit</a>
|
|
<a href="{{ route('frontdesk.visits.create') }}" class="btn-primary">
|
|
<svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/></svg>
|
|
Check in visitor
|
|
</a>
|
|
</x-slot>
|
|
</x-frontdesk.page-hero>
|
|
|
|
<form method="GET" class="flex flex-wrap gap-2">
|
|
<input type="search" name="q" value="{{ request('q') }}" placeholder="Search visitors…" class="rounded-lg border-slate-300 text-sm">
|
|
<select name="status" class="rounded-lg border-slate-300 text-sm">
|
|
<option value="">All statuses</option>
|
|
@foreach (config('frontdesk.visit_statuses') as $key => $label)
|
|
<option value="{{ $key }}" @selected(request('status') === $key)>{{ $label }}</option>
|
|
@endforeach
|
|
</select>
|
|
<x-btn type="submit" variant="secondary" size="sm">Filter</x-btn>
|
|
</form>
|
|
|
|
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
|
|
<div class="border-b border-slate-100 px-6 py-4">
|
|
<h2 class="text-sm font-semibold text-slate-900">Visit history</h2>
|
|
</div>
|
|
<table class="min-w-full divide-y divide-slate-100 text-sm">
|
|
<thead class="bg-slate-50 text-left text-xs uppercase text-slate-500">
|
|
<tr>
|
|
<th class="px-4 py-3">Visitor</th>
|
|
<th class="px-4 py-3">Host</th>
|
|
<th class="px-4 py-3">Type</th>
|
|
<th class="px-4 py-3">Status</th>
|
|
<th class="px-4 py-3">Time</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-slate-50">
|
|
@forelse ($visits as $visit)
|
|
<tr class="hover:bg-slate-50">
|
|
<td class="px-4 py-3"><a href="{{ route('frontdesk.visits.show', $visit) }}" class="font-medium text-indigo-700">{{ $visit->visitor->full_name }}</a></td>
|
|
<td class="px-4 py-3 text-slate-600">{{ $visit->host?->name ?? '—' }}</td>
|
|
<td class="px-4 py-3 capitalize text-slate-600">{{ str_replace('_', ' ', $visit->visitor_type) }}</td>
|
|
<td class="px-4 py-3 capitalize text-slate-600">{{ str_replace('_', ' ', $visit->status) }}</td>
|
|
<td class="px-4 py-3 text-slate-500">{{ $visit->checked_in_at?->format('M j, g:i A') ?? $visit->scheduled_at?->format('M j, g:i A') ?? $visit->created_at->format('M j, g:i A') }}</td>
|
|
</tr>
|
|
@empty
|
|
<tr><td colspan="5" class="px-4 py-8 text-center text-slate-400">No visits yet.</td></tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
@if ($visits->hasPages())
|
|
<div class="border-t border-slate-100 px-5 py-3">{{ $visits->links() }}</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|