<?php

namespace App\Livewire\Shell;

use App\Models\Server;
use Livewire\Component;

/**
 * Topbar "X / Y online" pill. A tiny polled Livewire island so the fleet-online count reflects a
 * server going up or down live (like the dashboard), instead of only on a page navigate/refresh.
 */
class FleetStatus extends Component
{
    public function render()
    {
        return view('livewire.shell.fleet-status', [
            'online' => Server::where('status', 'online')->count(),
            'total' => Server::count(),
        ]);
    }
}
