<?php

namespace LaraBB\Category\UI\Web\Handlers\Admin;

use App\Http\Controllers\Controller;
use Illuminate\Contracts\View\View;
use Illuminate\View\Factory;
use LaraBB\Category\Actions\Admin\IndexAction;

/**
 * Class OverviewHandler
 * @package LaraBB\Category\UI\Web\Handlers\Admin
 */
class IndexHandler extends Controller
{

    /**
     * @param IndexAction $indexAction
     * @param Factory $view
     */
    public function __construct(
        private readonly IndexAction $indexAction,
        private readonly Factory $view
    ) {

    }

    /**
     * @return View
     */
    public function __invoke(): View
    {
        return $this->view->make('category::admin.index', $this->indexAction->run());
    }
}
