<?php

declare(strict_types=1);

namespace Seka\Portal\Modul\Terminy\Livewire\Backend\Udalosti\Components;

use Illuminate\Contracts\View\View;
use Seka\Portal\Modul\Terminy\Livewire\Components\Udalosti\Zoznam as ZoznamAbstract;

/**
 * Class Zoznam
 *
 * @package Seka\Portal\Modul\Terminy\Livewire\Backend\Udalosti\Components
 */
final class Zoznam extends ZoznamAbstract
{
    /**
     * @var string
     */
    protected string $createPath = 'modul.terminy.backend.udalosti.udalost.create';

    /**
     * @var string
     */
    protected string $editPath = 'modul.terminy.backend.udalosti.udalost.edit';

    /**
     * @return \Illuminate\Contracts\View\View
     * @throws \Illuminate\Contracts\Container\BindingResolutionException
     */
    public function render(): View
    {
        $udalosti = $this->getQuery()->paginate(self::PER_PAGE);

        return view('Terminy::livewire.backend.udalosti.components.zoznam')
            ->withUdalosti($udalosti)
            ->withCreatePath($this->createPath)
            ->withEditPath($this->editPath);
    }
}
