<?php

namespace App\Http\Livewire;

use Livewire\Component;

class ForcedLogoutModal extends Component
{
    public $showModal = false;
    public $message = '';
    public $title = '';

    protected $listeners = ['showForcedLogoutModal'];

    public function showForcedLogoutModal($message, $title = 'Logged Out')
    {
        $this->message = $message;
        $this->title = $title;
        $this->showModal = true;
    }

    public function confirmLogout()
    {
        // Dispatch browser event to submit logout form
        $this->dispatch('proceed-logout');
    }

    public function render()
    {
        return view('livewire.forced-logout-modal');
    }
}
