<?php

declare(strict_types=1);

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

use Livewire\Component;
use Illuminate\Contracts\View\View;
use Seka\Terminy\Models\Udalost\Udalost;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;

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

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

    /**
     * @param \Seka\Terminy\Models\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');
    }
}
