openreplay/frontend/app/components/ui/Form/Form.tsx
Andrey Babushkin fd5c0c9747
Add lokalisation (#3092)
* applied eslint

* add locales and lint the project

* removed error boundary

* updated locales

* fix min files

* fix locales
2025-03-06 17:43:15 +01:00

41 lines
712 B
TypeScript

import React from 'react';
interface Props {
children: React.ReactNode;
onSubmit?: any;
[x: string]: any;
}
interface FormFieldProps {
children: React.ReactNode;
[x: string]: any;
}
function FormField(props: FormFieldProps) {
const { children, ...rest } = props;
return (
<div {...rest} className="flex flex-col mb-4 form-field">
{children}
</div>
);
}
function Form(props: Props) {
const { children, ...rest } = props;
return (
<form
{...rest}
onSubmit={(e) => {
e.preventDefault();
if (props.onSubmit) {
props.onSubmit(e);
}
}}
>
{children}
</form>
);
}
Form.Field = FormField;
export default Form;