import { cloneElement } from 'react'; import { Button, Icon } from '@akinon/next/components'; import { AgreementAndSubmitProps } from '../types'; export const AgreementAndSubmit = ({ agreementCheckbox, control, errors, buttonText, formError, isSubmitting }: AgreementAndSubmitProps) => (
{agreementCheckbox && cloneElement(agreementCheckbox as any, { control: control as any, error: errors.agreement, fieldId: 'agreement' })} {formError?.non_field_errors && (
{formError.non_field_errors}
)} {formError?.status && (
{formError.status}
)}
);