<?php

declare(strict_types=1);

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

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

/**
 * Class Upravit
 *
 * @package Seka\Portal\Modul\Terminy\Http\Controllers\Backend\Udalosti\Livewire\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::pages.udalosti.backend.livewire.upravit');
    }
}
