<?php

declare(strict_types=1);

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

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

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

    /**
     * @var \Seka\Terminy\Models\MiestoKonania\MiestoKonania
     */
    public MiestoKonania $miesto;

    /**
     * @param \Seka\Terminy\Models\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::pages.adresar.backend.livewire.upravit');
    }
}
