Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | 134x 804x | import { REGISTRATION_FIELDS } from '../../constants/formFields';
import FormField from '../FormField/FormField';
import './RegistrationForm.css';
function RegistrationForm({
title = 'Inscription',
description = 'Remplissez le formulaire pour enregistrer vos informations.',
formValues,
fieldErrors,
isSubmitDisabled,
onChange,
onSubmit
}) {
return (
<form className="register-form" onSubmit={onSubmit}>
<h1>{title}</h1>
<p>{description}</p>
<div className="field-grid">
{REGISTRATION_FIELDS.map((field) => (
<FormField
key={field.name}
label={field.label}
name={field.name}
type={field.type}
placeholder={field.placeholder}
testId={field.testId}
errorTestId={field.errorTestId}
value={formValues[field.name]}
error={fieldErrors[field.name]}
onChange={onChange}
/>
))}
</div>
<button type="submit" data-testid="submit" disabled={isSubmitDisabled}>
Enregistrer
</button>
</form>
);
}
export default RegistrationForm;
|