Deploy Ladill Care / deploy (push) Successful in 37s
Introduce shared x-care.page-hero with summary stats so key list views match the Ladill app hero pattern used across Frontdesk and Link. Co-authored-by: Cursor <cursoragent@cursor.com>
48 lines
2.6 KiB
PHP
48 lines
2.6 KiB
PHP
<x-app-layout title="Team members">
|
|
<div class="space-y-6">
|
|
<x-care.page-hero
|
|
badge="Roles · Access · Branch assignment"
|
|
title="Team"
|
|
description="Manage who can access Care, their roles, and which branch each member belongs to."
|
|
:stats="[
|
|
['value' => number_format($heroStats['total']), 'label' => 'Members'],
|
|
['value' => number_format($heroStats['clinical']), 'label' => 'Clinical staff'],
|
|
['value' => number_format($heroStats['branches']), 'label' => 'Branches staffed'],
|
|
]">
|
|
<x-slot name="actions">
|
|
<a href="{{ route('care.members.create') }}" class="btn-primary">Add member</a>
|
|
</x-slot>
|
|
</x-care.page-hero>
|
|
|
|
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
|
|
<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('care.members.destroy', $member) }}" class="inline" onsubmit="return confirm('Remove this member?')">
|
|
@csrf @method('DELETE')
|
|
<button type="submit" class="text-red-600">Remove</button>
|
|
</form>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|