<?php

declare(strict_types=1);

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

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

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

    /**
     * @var \Seka\Portal\Modul\Terminy\Entities\MiestoKonania\MiestoKonania
     */
    public MiestoKonania $miesto;

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

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

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