<?php

namespace App\Http\Livewire\Components\Informacia\Pages;

use App\Models\Informacia\Informacia;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\View;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Livewire\Component;

/**
 * Class Vytvorit
 *
 * @package App\Http\Livewire\Components\Informacia\Pages
 */
class Vytvorit extends Component
{
    use AuthorizesRequests;

    /**
     * @var \App\Models\Informacia\Informacia
     */
    public Informacia $informacia;

    /**
     * @param \App\Models\Informacia\Informacia $informacia
     *
     * @return void
     */
    public function mount(Informacia $informacia): void
    {
        $this->informacia = $informacia;
    }

    /**
     * @throws AuthorizationException
     */
    public function render(): View
    {
        $this->authorize('portal_sprava_informacie');

        return view('pages.sprava.informacie.livewire.create');
    }
}
