2025-11-27 13:48:24 +07:00
|
|
|
|
'use client'
|
|
|
|
|
|
|
2025-12-27 12:10:13 +07:00
|
|
|
|
import styles from '@/app/styles/module/login.module.scss';
|
2025-12-22 13:02:39 +07:00
|
|
|
|
import { ChangeEvent, useActionState, useEffect, useRef, useState } from 'react';
|
2026-01-14 18:15:52 +07:00
|
|
|
|
import { registration, FormState, confirmEmail } from '@/app/actions/auth';
|
2025-12-08 13:57:26 +07:00
|
|
|
|
import PhoneInput from '@/app/ui/inputs/phone-input';
|
2025-12-10 11:42:52 +07:00
|
|
|
|
import Link from 'next/link';
|
2025-12-10 16:39:13 +07:00
|
|
|
|
import { useTranslations } from 'next-intl';
|
2025-12-15 12:22:42 +07:00
|
|
|
|
import { IconEye } from '@/app/ui/icons/icons';
|
2025-12-22 13:02:39 +07:00
|
|
|
|
import { SignupFormSchema } from '@/app/actions/definitions';
|
|
|
|
|
|
import * as z from 'zod'
|
2025-11-27 13:48:24 +07:00
|
|
|
|
|
|
|
|
|
|
export default function RegisterForm() {
|
2025-12-07 12:53:56 +07:00
|
|
|
|
const [state, formAction, isPending] = useActionState(
|
2025-11-27 13:48:24 +07:00
|
|
|
|
registration,
|
|
|
|
|
|
undefined,
|
|
|
|
|
|
);
|
|
|
|
|
|
|
2026-01-14 18:15:52 +07:00
|
|
|
|
const [stateEmailConfrim, formActionEmailConfrim, isPendingEmailConfrim] = useActionState(
|
|
|
|
|
|
confirmEmail,
|
|
|
|
|
|
undefined,
|
|
|
|
|
|
);
|
|
|
|
|
|
|
2025-12-22 13:02:39 +07:00
|
|
|
|
const t = useTranslations('Login-register-form');
|
2025-12-15 12:22:42 +07:00
|
|
|
|
const [showPassword, setShowPassword] = useState(false);
|
2025-12-16 10:11:39 +07:00
|
|
|
|
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
|
2025-12-22 13:02:39 +07:00
|
|
|
|
const [formState, setFormState] = useState<FormState | undefined>(undefined);
|
2026-01-14 18:15:52 +07:00
|
|
|
|
const [showMailConfirmWindow, setShowMailConfirmWindow] = useState(false);
|
2025-12-22 13:02:39 +07:00
|
|
|
|
const passwordRef = useRef<HTMLInputElement>(null);
|
2026-01-29 17:01:00 +07:00
|
|
|
|
const [accountType, setAccountType] = useState<'b2c' | 'b2b'>('b2c');
|
2025-12-22 13:02:39 +07:00
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
setFormState(state);
|
2026-01-14 18:15:52 +07:00
|
|
|
|
if (state?.mailConfirm) {
|
|
|
|
|
|
setShowMailConfirmWindow(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-22 13:02:39 +07:00
|
|
|
|
}, [state])
|
2025-12-15 12:22:42 +07:00
|
|
|
|
|
2025-12-22 14:30:25 +07:00
|
|
|
|
function showPassowrd(target: 'password' | 'confirm-password') {
|
2025-12-16 10:11:39 +07:00
|
|
|
|
if (target === 'password') {
|
2025-12-22 14:30:25 +07:00
|
|
|
|
setShowPassword(!showPassword);
|
2025-12-16 10:11:39 +07:00
|
|
|
|
} else {
|
2025-12-22 14:30:25 +07:00
|
|
|
|
setShowConfirmPassword(!showConfirmPassword);
|
2025-12-16 10:11:39 +07:00
|
|
|
|
}
|
2025-12-15 12:22:42 +07:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-22 13:02:39 +07:00
|
|
|
|
function validateField(
|
|
|
|
|
|
fieldName: string,
|
|
|
|
|
|
value: string,
|
|
|
|
|
|
) {
|
|
|
|
|
|
switch (fieldName) {
|
|
|
|
|
|
case 'confirm_password':
|
|
|
|
|
|
const baseSchema = SignupFormSchema.shape.confirm_password;
|
|
|
|
|
|
const baseResult = baseSchema.safeParse(value);
|
|
|
|
|
|
|
|
|
|
|
|
if (!baseResult.success) {
|
|
|
|
|
|
return baseResult;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const currentPassword = passwordRef.current?.value || '';
|
|
|
|
|
|
if (value !== currentPassword) {
|
|
|
|
|
|
return {
|
|
|
|
|
|
success: false,
|
|
|
|
|
|
error: new z.ZodError([
|
|
|
|
|
|
{
|
|
|
|
|
|
code: z.ZodIssueCode.custom,
|
|
|
|
|
|
message: 'repeat-password',
|
|
|
|
|
|
path: ['confirm_password']
|
|
|
|
|
|
}
|
|
|
|
|
|
])
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return { success: true, data: value };
|
|
|
|
|
|
|
|
|
|
|
|
case 'email':
|
|
|
|
|
|
case 'fullName':
|
|
|
|
|
|
case 'phone':
|
|
|
|
|
|
case 'password':
|
2026-01-09 19:46:59 +07:00
|
|
|
|
case 'companyName':
|
2025-12-22 13:02:39 +07:00
|
|
|
|
case 'agree':
|
|
|
|
|
|
const schema = SignupFormSchema.shape[fieldName];
|
|
|
|
|
|
if (fieldName === 'phone') {
|
|
|
|
|
|
return schema.safeParse(value.replace(/[-\(\)\s]/g, ''));
|
|
|
|
|
|
}
|
2026-02-03 17:36:09 +07:00
|
|
|
|
if (fieldName === 'companyName' && accountType === 'b2c') {
|
2026-01-29 21:34:02 +07:00
|
|
|
|
return { success: true, data: value };
|
|
|
|
|
|
}
|
2025-12-22 13:02:39 +07:00
|
|
|
|
return schema.safeParse(value);
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
throw new Error(`Unknown field: ${fieldName}`);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function onChangeHandler(e: ChangeEvent<HTMLInputElement>): void {
|
|
|
|
|
|
const fieldName = e.target.name;
|
2026-01-09 19:46:59 +07:00
|
|
|
|
if (fieldName !== 'phone') {
|
2026-01-14 19:24:01 +07:00
|
|
|
|
e.target.value = e.target.value.replace(/([^a-zA-Zа-яёА-ЯЁ0-9@.!#$%&"'*+/=?^_{|}~\-\s])/g, '');
|
2026-01-09 19:46:59 +07:00
|
|
|
|
}
|
2025-12-22 13:02:39 +07:00
|
|
|
|
const validatedField = validateField(fieldName, e.target.value);
|
|
|
|
|
|
|
|
|
|
|
|
if (validatedField.success) {
|
|
|
|
|
|
setFormState(prevState => {
|
|
|
|
|
|
if (!prevState?.error || !prevState?.error[fieldName]) {
|
|
|
|
|
|
return prevState;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const { [fieldName]: _, ...newError } = prevState.error;
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
...prevState,
|
|
|
|
|
|
error: newError
|
|
|
|
|
|
};
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-29 17:01:00 +07:00
|
|
|
|
function switchRegistrationTypeHandler(e: React.MouseEvent<HTMLButtonElement>, type: 'b2c' | 'b2b') {
|
2026-01-29 14:34:04 +07:00
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
setAccountType(type);
|
2026-02-05 17:37:27 +07:00
|
|
|
|
if (formState) {
|
2026-01-29 14:34:04 +07:00
|
|
|
|
setFormState({
|
|
|
|
|
|
...formState,
|
|
|
|
|
|
previousState: {
|
|
|
|
|
|
...formState.previousState,
|
|
|
|
|
|
companyName: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
error: {
|
|
|
|
|
|
...formState.error,
|
|
|
|
|
|
companyName: ''
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-27 13:48:24 +07:00
|
|
|
|
return (
|
2026-01-14 18:15:52 +07:00
|
|
|
|
<>
|
|
|
|
|
|
{showMailConfirmWindow && (
|
2025-12-22 14:30:25 +07:00
|
|
|
|
<div
|
2026-01-14 18:15:52 +07:00
|
|
|
|
className="modal-wrapper"
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
setShowMailConfirmWindow(false);
|
|
|
|
|
|
}}
|
2025-12-22 14:30:25 +07:00
|
|
|
|
>
|
2026-01-14 18:15:52 +07:00
|
|
|
|
<div
|
|
|
|
|
|
className="modal-window"
|
|
|
|
|
|
onClick={(e) => e.stopPropagation()}
|
|
|
|
|
|
>
|
|
|
|
|
|
<div className={`${styles['form-group']} ${styles['form-group-confrim-window']}`}>
|
|
|
|
|
|
<form action={(e) => {
|
|
|
|
|
|
formActionEmailConfrim(e);
|
|
|
|
|
|
}}>
|
|
|
|
|
|
<div className={`${styles['form-group']}`}>
|
|
|
|
|
|
<h4
|
|
|
|
|
|
className="mb-6"
|
|
|
|
|
|
>
|
|
|
|
|
|
{t('enter-confirmation-code')}
|
|
|
|
|
|
</h4>
|
|
|
|
|
|
<label
|
|
|
|
|
|
className={`${styles['form-label']}`}
|
|
|
|
|
|
>
|
|
|
|
|
|
{t('confirmation-code')}
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
id="emailConfirm"
|
|
|
|
|
|
name="emailConfirm"
|
|
|
|
|
|
className={`${styles['form-input']}`}
|
|
|
|
|
|
placeholder="mail-code"
|
|
|
|
|
|
defaultValue=""
|
|
|
|
|
|
onChange={(e) => {
|
|
|
|
|
|
}}
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<button type="submit" className={`${styles['btn']}`}>
|
|
|
|
|
|
Проверить
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
)}
|
|
|
|
|
|
<form action={(e) => {
|
|
|
|
|
|
formAction(e);
|
|
|
|
|
|
}}>
|
2026-01-29 14:34:04 +07:00
|
|
|
|
<div className={`${styles['form-switcher']}`}>
|
|
|
|
|
|
<button
|
2026-01-29 17:01:00 +07:00
|
|
|
|
className={`${styles['form-switcher-button']} ${accountType === 'b2c' ? styles['active'] : ''}`}
|
2026-01-29 14:34:04 +07:00
|
|
|
|
onClick={(e) => {
|
2026-01-29 17:01:00 +07:00
|
|
|
|
switchRegistrationTypeHandler(e, 'b2c');
|
2026-01-29 14:34:04 +07:00
|
|
|
|
}}
|
|
|
|
|
|
>
|
2026-01-29 14:48:54 +07:00
|
|
|
|
{t('personal')}
|
2026-01-29 14:34:04 +07:00
|
|
|
|
</button>
|
|
|
|
|
|
<button
|
2026-01-29 17:01:00 +07:00
|
|
|
|
className={`${styles['form-switcher-button']} ${accountType === 'b2b' ? styles['active'] : ''}`}
|
2026-01-29 14:34:04 +07:00
|
|
|
|
onClick={(e) => {
|
2026-01-29 17:01:00 +07:00
|
|
|
|
switchRegistrationTypeHandler(e, 'b2b');
|
2026-01-29 14:34:04 +07:00
|
|
|
|
}}
|
|
|
|
|
|
>
|
2026-01-29 14:48:54 +07:00
|
|
|
|
{t('company')}
|
2026-01-29 14:34:04 +07:00
|
|
|
|
</button>
|
|
|
|
|
|
<input
|
2026-02-05 11:55:02 +07:00
|
|
|
|
type="hidden"
|
2026-01-29 17:01:00 +07:00
|
|
|
|
id="accountType"
|
|
|
|
|
|
name="accountType"
|
2026-01-29 14:34:04 +07:00
|
|
|
|
className={`${styles['form-input-hidden']}`}
|
2026-02-05 11:55:02 +07:00
|
|
|
|
value={accountType}
|
2026-01-29 14:34:04 +07:00
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-01-14 18:15:52 +07:00
|
|
|
|
<div className={`${styles['form-group']}`}>
|
|
|
|
|
|
<label
|
|
|
|
|
|
className={`${styles['form-label']} ${styles['required']}`}
|
|
|
|
|
|
>
|
|
|
|
|
|
{t('full-name')}
|
|
|
|
|
|
</label>
|
2025-12-22 14:30:25 +07:00
|
|
|
|
<input
|
2026-01-14 18:15:52 +07:00
|
|
|
|
type="text"
|
|
|
|
|
|
id="fullName"
|
|
|
|
|
|
name="fullName"
|
|
|
|
|
|
className={`${styles['form-input']}`}
|
|
|
|
|
|
placeholder={t('name-placeholder')}
|
|
|
|
|
|
defaultValue={formState?.previousState?.fullName ? formState?.previousState?.fullName : ''}
|
2025-12-22 14:30:25 +07:00
|
|
|
|
onChange={onChangeHandler}
|
|
|
|
|
|
/>
|
2026-01-14 18:15:52 +07:00
|
|
|
|
{formState?.error?.fullName && (
|
|
|
|
|
|
<p className="text-sm text-red-500">
|
|
|
|
|
|
{
|
|
|
|
|
|
formState?.error?.fullName.split('&').map((e, index) => {
|
|
|
|
|
|
return (
|
|
|
|
|
|
<span key={index}>
|
|
|
|
|
|
{t(e)}
|
|
|
|
|
|
<br />
|
|
|
|
|
|
</span>
|
|
|
|
|
|
)
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
</p>
|
|
|
|
|
|
)}
|
2025-11-27 13:48:24 +07:00
|
|
|
|
</div>
|
2025-12-22 14:30:25 +07:00
|
|
|
|
|
2026-01-29 17:01:00 +07:00
|
|
|
|
{accountType === 'b2b' && (
|
2026-01-29 14:34:04 +07:00
|
|
|
|
<div className={`${styles['form-group']}`}>
|
|
|
|
|
|
<label
|
|
|
|
|
|
className={`${styles['form-label']} ${styles['required']}`}
|
|
|
|
|
|
>
|
|
|
|
|
|
{t('company')}
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
id="companyName"
|
|
|
|
|
|
name="companyName"
|
|
|
|
|
|
className={`${styles['form-input']}`}
|
|
|
|
|
|
placeholder={t('company-placeholder')}
|
|
|
|
|
|
defaultValue={formState?.previousState?.companyName ? formState?.previousState?.companyName : ''}
|
|
|
|
|
|
onChange={onChangeHandler}
|
|
|
|
|
|
/>
|
|
|
|
|
|
{formState?.error?.companyName && (
|
|
|
|
|
|
<p className="text-sm text-red-500">
|
|
|
|
|
|
{
|
|
|
|
|
|
formState?.error?.companyName.split('&').map((e, index) => {
|
|
|
|
|
|
return (
|
|
|
|
|
|
<span key={index}>
|
|
|
|
|
|
{t(e)}
|
|
|
|
|
|
<br />
|
|
|
|
|
|
</span>
|
|
|
|
|
|
)
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
</p>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
2026-01-14 18:15:52 +07:00
|
|
|
|
<div className={`${styles['form-group']}`}>
|
|
|
|
|
|
<label className={`${styles['form-label']} ${styles['required']}`}>
|
|
|
|
|
|
{t('email-adress')}
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
id="email"
|
|
|
|
|
|
name="email"
|
|
|
|
|
|
className={`${styles['form-input']}`}
|
|
|
|
|
|
placeholder="ivan@example.com"
|
|
|
|
|
|
defaultValue={formState?.previousState?.email ? formState?.previousState?.email : ''}
|
|
|
|
|
|
onChange={(e) => {
|
|
|
|
|
|
e.target.value = e.target.value.toLocaleLowerCase();
|
|
|
|
|
|
onChangeHandler(e)
|
|
|
|
|
|
}}
|
|
|
|
|
|
/>
|
|
|
|
|
|
{formState?.error?.email && (
|
|
|
|
|
|
<p className="text-sm text-red-500">
|
|
|
|
|
|
{
|
|
|
|
|
|
formState?.error?.email.split('&').map((e, index) => {
|
|
|
|
|
|
return (
|
|
|
|
|
|
<span key={index}>
|
|
|
|
|
|
{t(e)}
|
|
|
|
|
|
<br />
|
|
|
|
|
|
</span>
|
|
|
|
|
|
)
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
</p>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div className={`${styles['form-group']}`}>
|
|
|
|
|
|
<label className={`${styles['form-label']} ${styles['required']}`}>
|
|
|
|
|
|
{t('phone')}
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<PhoneInput phoneState={formState?.previousState?.phone} validateHandler={onChangeHandler} />
|
|
|
|
|
|
{formState?.error?.phone && (
|
|
|
|
|
|
<p className="text-sm text-red-500">
|
|
|
|
|
|
{
|
|
|
|
|
|
formState?.error?.phone.split('&').map((e, index) => {
|
|
|
|
|
|
return (
|
|
|
|
|
|
<span key={index}>
|
|
|
|
|
|
{t(e)}
|
|
|
|
|
|
<br />
|
|
|
|
|
|
</span>
|
|
|
|
|
|
)
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
</p>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className={`${styles['form-group']}`}>
|
|
|
|
|
|
<label className={`${styles['form-label']} ${styles['required']}`}>
|
|
|
|
|
|
{t('password')}
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<div
|
|
|
|
|
|
className={`${styles['password-wrapper']}`}
|
2025-12-12 11:43:28 +07:00
|
|
|
|
>
|
2026-01-14 18:15:52 +07:00
|
|
|
|
<input
|
|
|
|
|
|
ref={passwordRef}
|
|
|
|
|
|
type={showPassword ? "text" : "password"}
|
|
|
|
|
|
id="password"
|
|
|
|
|
|
name="password"
|
|
|
|
|
|
className={`${styles['form-input']} ${styles['password']}`}
|
|
|
|
|
|
placeholder={t('password-placeholder')}
|
|
|
|
|
|
defaultValue={formState?.previousState?.password ? formState?.previousState?.password : ''}
|
|
|
|
|
|
onChange={onChangeHandler}
|
|
|
|
|
|
/>
|
|
|
|
|
|
<button
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
showPassowrd('password')
|
|
|
|
|
|
}}
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
className={`show-password-button ${showPassword ? 'show' : ''}`}
|
|
|
|
|
|
>
|
|
|
|
|
|
<IconEye />
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{formState?.error?.password && (
|
|
|
|
|
|
<p className="text-sm text-red-500">
|
|
|
|
|
|
{
|
|
|
|
|
|
formState?.error?.password.split('&').map((e, index) => {
|
|
|
|
|
|
return (
|
|
|
|
|
|
<span key={index}>
|
|
|
|
|
|
{t(e)}
|
|
|
|
|
|
<br />
|
|
|
|
|
|
</span>
|
|
|
|
|
|
)
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
</p>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div className={`${styles['form-group']}`}>
|
|
|
|
|
|
<label className={`${styles['form-label']} ${styles['required']}`}>
|
|
|
|
|
|
{t('confirm-password')}
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<div className={`${styles['password-wrapper']}`}>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type={showConfirmPassword ? "text" : "password"}
|
|
|
|
|
|
id="confirm_password"
|
|
|
|
|
|
name="confirm_password"
|
|
|
|
|
|
className={`${styles['form-input']} ${styles['password']}`}
|
|
|
|
|
|
placeholder={t('repeat-password')}
|
|
|
|
|
|
defaultValue={formState?.previousState?.confirm_password ? formState?.previousState?.confirm_password : ''}
|
|
|
|
|
|
onChange={onChangeHandler}
|
|
|
|
|
|
/>
|
|
|
|
|
|
<button
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
showPassowrd('confirm-password');
|
|
|
|
|
|
}}
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
className={`show-password-button ${showConfirmPassword ? 'show' : ''}`}
|
|
|
|
|
|
>
|
|
|
|
|
|
<IconEye />
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{formState?.error?.confirm_password && (
|
|
|
|
|
|
<p className="text-sm text-red-500">
|
|
|
|
|
|
{t(formState?.error?.confirm_password)}
|
|
|
|
|
|
</p>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className={`${styles['form-checkbox']}`}>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="checkbox"
|
|
|
|
|
|
id="agree"
|
|
|
|
|
|
name="agree"
|
|
|
|
|
|
defaultChecked={formState?.previousState?.agree ? true : false}
|
|
|
|
|
|
onChange={onChangeHandler}
|
|
|
|
|
|
/>
|
|
|
|
|
|
<label htmlFor="agree">
|
|
|
|
|
|
{t('i-agree-to')} <Link
|
|
|
|
|
|
href="/terms-of-use"
|
|
|
|
|
|
target="_blank"
|
|
|
|
|
|
>
|
|
|
|
|
|
{t('terms-of-use')}
|
|
|
|
|
|
</Link> {t('and')} <Link
|
|
|
|
|
|
href="/privacy-policy"
|
|
|
|
|
|
target="_blank"
|
|
|
|
|
|
>
|
|
|
|
|
|
{t('privacy-policy')}
|
|
|
|
|
|
</Link>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{formState?.error?.agree && (
|
|
|
|
|
|
<p className="text-sm text-red-500">
|
|
|
|
|
|
{t(formState?.error?.agree)}
|
|
|
|
|
|
</p>
|
|
|
|
|
|
)}
|
|
|
|
|
|
{formState?.error?.server && (
|
|
|
|
|
|
<p className="text-sm text-red-500 mt-4">
|
|
|
|
|
|
{t(formState?.error?.server)}
|
|
|
|
|
|
</p>
|
|
|
|
|
|
)}
|
|
|
|
|
|
<button type="submit" className={`${styles['btn']}`}>
|
|
|
|
|
|
{t('create-an-account')}
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</form >
|
|
|
|
|
|
</>
|
2025-11-27 13:48:24 +07:00
|
|
|
|
)
|
|
|
|
|
|
}
|