<?php

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

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

/**
 * Class OverviewHandler
 * @package LaraBB\User\UI\Web\Handlers\Admin
 */
class IndexHandler extends Controller
{
    /**
     * OverviewHandler constructor.
     * @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('user::admin.index', $this->indexAction->run());
    }
}
