<?php

namespace LaraBB\User\UI\Web\Handlers;

use App\Http\Controllers\Controller;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
use LaraBB\User\Actions\RegisterPageAction;
use LaraBB\User\UI\Web\Requests\Register\Show;

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

    }

    /**
     * @param Show $request
     * @return View
     */
    public function __invoke(Show $request): View
    {
        return $this->view->make('user::register', $this->registerPageAction->run($request));
    }
}
