<?php

namespace apexl\Io\modules\userDisplay\forms;

use apexl\Io\includes\RouteManager;
use apexl\Io\includes\System;
use apexl\Io\modules\formbuilder\entities\formEntity;
use apexl\Io\modules\formbuilder\includes\inputField;
use apexl\Io\modules\formbuilder\includes\linkField;

class forgottenPasswordForm
{
    public function forgottenPasswordForm()
    {
        $form = new formEntity();
        $form->setMethod('post');
        $form->setActionUrl($this->routeManager->getRoutePattern('user.forgot-password'));
        $form->setSubmitText('Get Reset Link');

        $form->addField(
            (new inputField('email'))->setPlaceholder(
                System::getVariable('user_login_email_placeholder') ?? 'Enter your email address'
            )->setLabel('Email Address')->setInputType('email')->isRequired()
        );

        return $form->getBuiltFormArray();
    }
}
