<?php

namespace App\Http\Livewire\Admin;

use Livewire\Attributes\On;
use Livewire\Component;

class MaintenanceBanner extends Component
{
    public $maintenanceMode = false;

    public function mount()
    {
        $this->maintenanceMode = isMaintenanceMode();
    }

    #[On('maintenance-mode-changed')]
    public function refreshMaintenanceMode()
    {
        $this->maintenanceMode = isMaintenanceMode();
    }

    public function render()
    {
        return view('livewire.admin.maintenance-banner');
    }
}
