<?php

declare(strict_types=1);

namespace Seka\Portal\Modul\Terminy\Livewire\Backend\Udalosti\Pages;

use Illuminate\Contracts\View\View;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Livewire\Component;
use Seka\Portal\Modul\Terminy\Entities\Udalost\Udalost;

/**
 * Class Upravit
 *
 * @package Seka\Portal\Modul\Terminy\Livewire\Backend\Udalosti\Pages
 */
final class Upravit extends Component
{
    use AuthorizesRequests;

    /**
     * @var Udalost
     */
    public $udalost;

    /**
     * @param \Seka\Portal\Modul\Terminy\Entities\Udalost\Udalost $udalost
     */
    public function mount(Udalost $udalost): void
    {
        $this->udalost = $udalost;
    }

    /**
     * @return \Illuminate\Contracts\View\View
     * @throws \Illuminate\Auth\Access\AuthorizationException
     * @throws \Illuminate\Contracts\Container\BindingResolutionException
     */
    public function render(): View
    {
        $this->authorize('terminy.udalosti.upravit');

        return view('Terminy::livewire.backend.udalosti.pages.upravit');
    }
}
