<?php

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

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

/**
 * Class OverviewHandler
 * @package LaraBB\Forum\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('forum::admin.index', $this->indexAction->run());
    }
}
