@php use App\Classes\MikrotikService\StaticOnlineStatus; @endphp @props(['client']) @php $static = StaticOnlineStatus::forClient($client); $speed = function ($bps) { if ($bps >= 1000000) return round($bps / 1000000, 1) . ' Mbps'; if ($bps >= 1000) return round($bps / 1000) . ' kbps'; return $bps . ' bps'; }; $lastSeen = $static['last_seen'] ? \Carbon\Carbon::createFromTimestamp($static['last_seen'])->diffForHumans() : null; @endphp @if ($static['status'] === 'online') Online @elseif ($static['status'] === 'offline') Offline{{ $lastSeen ? ' ยท ' . $lastSeen : '' }} @elseif ($static['status'] === 'disabled') Queue-Disabled @elseif ($static['status'] === 'no-queue') No Queue @endif