import React, { FC } from 'react'; import Button from '../../blocks/Button'; import { DropdownOption } from '../../blocks/Dropdown'; import Form from '../../blocks/Form'; import Input from '../../blocks/Input'; import { RadioItem } from '../../blocks/RadioButtons'; import InputPassword from '../InputPassword'; import css from './index.module.css'; export interface FormRegisterValues { firstName: string; lastName: string; emailAddress: string; phoneNumber: unknown; password: string; partnerType: string; company?: string; countryCode: string; trackingCode: string; passwordConfirm?: string; } export interface FormRegisterLabels { firstName: string; lastName: string; emailAddress: string; phoneNumber: string; password: string; company?: string; inProgress: string; showPassword: string; hidePassword: string; passwordConfirm?: string; accountInformation: string; contactInformation: string; partnerTypes: string; country: string; register: string; registerInfo: string; completeTitle: string; completeFeedback: string; modalTitle: string; next: { title: string; desc: string; stepsTitle: string; steps: Array; }; } export interface FormRegisterErrors { firstName?: string; lastName?: string; emailAddress?: string; phoneNumber?: { isValid: boolean; number: string; }; password?: string; passwordConfirm?: string; partnerType?: string; company?: string; countryCode?: string; } export interface FormRegisterTouched { [key: string]: unknown; } export interface FormRegisterProps { values: FormRegisterValues; touched: FormRegisterTouched; errors: FormRegisterErrors; labels: FormRegisterLabels; showAccountInfo: boolean; showButton: boolean; partnerTypes: RadioItem[]; countryCodes: DropdownOption[]; handleChange: (e) => void; handleBlur: (e) => void; handleSubmit: (e) => void; isSubmitting?: boolean; status?: { msg: string; }; partnerType: string; isSuccessful: boolean; } const FormRegister: FC = ({ values, touched, errors, handleChange, handleBlur, handleSubmit, labels, isSubmitting, status, showButton = true, isSuccessful, }) => (

{labels.modalTitle}

{!isSuccessful && ( <>

{labels.registerInfo}

{labels.accountInformation}

)}
{!isSuccessful ? ( <>
{showButton && (
)} {status && status.msg && (
{status.msg}
)} ) : ( <>

✔ {labels.completeTitle}

{labels.completeFeedback}

)}

{labels.next.title}

{labels.next.desc}

{labels.next.stepsTitle}

    {labels.next.steps.map((item, index) => { return
  • {item}
  • ; })}
); export default FormRegister;