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>
54 lines
3.0 KiB
PHP
54 lines
3.0 KiB
PHP
<x-app-layout title="Team">
|
|
<div class="space-y-6">
|
|
<x-frontdesk.page-hero
|
|
badge="Roles · Access · Branch scope"
|
|
title="Team"
|
|
description="Invite colleagues, assign Frontdesk roles, and limit branch access for reception and security staff."
|
|
:stats="[
|
|
['value' => number_format($heroStats['total']), 'label' => 'Members'],
|
|
['value' => number_format($heroStats['admins']), 'label' => 'Administrators'],
|
|
['value' => number_format($heroStats['branch_scoped']), 'label' => 'Branch-scoped'],
|
|
]">
|
|
<x-slot name="actions">
|
|
<a href="{{ route('frontdesk.members.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>
|
|
Add member
|
|
</a>
|
|
</x-slot>
|
|
</x-frontdesk.page-hero>
|
|
|
|
<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">Team members</h2>
|
|
</div>
|
|
<table class="min-w-full text-sm">
|
|
<thead class="bg-slate-50 text-left text-xs uppercase text-slate-500">
|
|
<tr><th class="px-4 py-3">Member</th><th class="px-4 py-3">Role</th><th class="px-4 py-3">Branch</th><th class="px-4 py-3"></th></tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-slate-50">
|
|
@foreach ($members as $member)
|
|
@php
|
|
$display = str_contains($member->user_ref, '@')
|
|
? $member->user_ref
|
|
: (\App\Models\User::where('public_id', $member->user_ref)->value('email') ?? $member->user_ref);
|
|
@endphp
|
|
<tr>
|
|
<td class="px-4 py-3 text-sm">{{ $display }}</td>
|
|
<td class="px-4 py-3">{{ $roles[$member->role] ?? $member->role }}</td>
|
|
<td class="px-4 py-3">{{ $member->branch?->name ?? 'All branches' }}</td>
|
|
<td class="px-4 py-3 text-right">
|
|
@if ($member->user_ref !== auth()->user()->public_id)
|
|
<form method="POST" action="{{ route('frontdesk.members.destroy', $member) }}" class="inline" onsubmit="return confirm('Remove this member?')">
|
|
@csrf @method('DELETE')
|
|
<x-btn type="submit" variant="danger" size="sm">Remove</x-btn>
|
|
</form>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|