Some checks failed
CI / lint-typecheck (pull_request) Failing after 13s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
33 lines
657 B
TypeScript
33 lines
657 B
TypeScript
import React, { ReactNode, FormEventHandler, forwardRef } from 'react';
|
|
|
|
export interface FormProps {
|
|
children: ReactNode;
|
|
onSubmit?: FormEventHandler<HTMLFormElement>;
|
|
noValidate?: boolean;
|
|
className?: string;
|
|
'data-testid'?: string;
|
|
}
|
|
|
|
export const Form = forwardRef<HTMLFormElement, FormProps>(({
|
|
children,
|
|
onSubmit,
|
|
noValidate = true,
|
|
className,
|
|
'data-testid': testId
|
|
}, ref) => {
|
|
return (
|
|
<form
|
|
ref={ref}
|
|
onSubmit={onSubmit}
|
|
noValidate={noValidate}
|
|
className={className}
|
|
style={{ width: '100%' }}
|
|
data-testid={testId}
|
|
>
|
|
{children}
|
|
</form>
|
|
);
|
|
});
|
|
|
|
Form.displayName = 'Form';
|