<?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\CreateAction;

/**
 * Class CreateHandler
 * @package LaraBB\User\UI\Web\Handlers\Admin
 */
class CreateHandler extends Controller
{
    /**
     * CreateHandler constructor.
     * @param CreateAction $createAction
     * @param Factory $view
     */
    public function __construct(private readonly CreateAction $createAction, private readonly Factory $view)
    {

    }

    /**
     * @return View
     */
    public function __invoke(): View
    {
        return $this->view->make('user::admin.create-edit', $this->createAction->run());
    }
}
