@extends('layouts.app') @php // One card renderer for all three tabs — the tabs differ by which list they // hold, not by how a person is drawn. $tabs = [ ['key' => 'online', 'label' => 'Online', 'people' => $online, 'colour' => 'green', 'empty' => 'Nobody has the timer running right now.'], ['key' => 'break', 'label' => 'On-Break', 'people' => $break, 'colour' => 'yellow', 'empty' => 'Nobody has stepped away.'], ['key' => 'absent', 'label' => 'Not Logged-In yet', 'people' => $absent, 'colour' => 'secondary', 'empty' => 'Everyone has started today.'], ]; @endphp @section('header')
Monitoring

Live People

@endsection @section('content') {{-- Toolbar — same filters as Live Screens. A real form here, unlike the Live Screens toolbar, because this page is server-rendered rather than fetching its own JSON. --}}
@if ($q !== '' || $status !== \App\Support\EmployeeStatus::ACTIVE) @endif
@foreach ($tabs as $i => $tab)
@forelse ($tab['people'] as $p) @if ($loop->first)
@endif
{{-- Square, matching the avatars everywhere else in the suite: Tabler's default .avatar shape, no rounding class. background-size/position are load-bearing — without them the image renders at natural size anchored top-left instead of filling the box. flex-shrink-0 keeps it from being squashed by a long name. Initials are the fallback, not a placeholder to swap out later: workspace-sourced employees have no avatar column, so most people keep them. --}} {{ $p['avatar_url'] ? '' : $p['initials'] }}
{{ $p['name'] }} @if ($p['employment'] !== \App\Support\EmployeeStatus::ACTIVE) {{ $p['employment'] }} @endif
{{ $p['position'] ?: '—' }}
{{-- Today's tracked activity. Its text colour is the free-time verdict: red short of the expected day, blue on it, green past it. --}} {{-- badge-outline: transparent, bordered in currentColor — so the border takes the free-time colour along with the text. --}} {{ $p['active_label'] }} {{-- Only when a shift is actually on file: no roster means no claim either way. --}} @if ($p['shift_ended']) Shift Ended @endif
{{-- mt-auto so the footer sits on the card's floor however tall the body above it runs — cards in a row are equal height, and a short one would otherwise float its footer mid-card. --}}
@if ($loop->last)
@endif @empty
{{ $tab['empty'] }}
@endforelse
@endforeach
@endsection