Files
element-call/src/form/Form.tsx

34 lines
723 B
TypeScript
Raw Normal View History

2022-05-04 17:09:48 +01:00
/*
Copyright 2022-2024 New Vector Ltd.
2022-05-04 17:09:48 +01:00
SPDX-License-Identifier: AGPL-3.0-only
Please see LICENSE in the repository root for full details.
2022-05-04 17:09:48 +01:00
*/
2022-01-04 16:00:13 -08:00
import classNames from "classnames";
import { FormEventHandler, forwardRef, ReactNode } from "react";
2022-07-07 23:40:29 +02:00
2022-01-04 16:00:13 -08:00
import styles from "./Form.module.css";
2022-07-29 15:07:35 +02:00
interface FormProps {
className: string;
onSubmit: FormEventHandler<HTMLFormElement>;
children: ReactNode[];
2022-07-29 15:07:35 +02:00
}
export const Form = forwardRef<HTMLFormElement, FormProps>(
({ children, className, onSubmit }, ref) => {
return (
<form
onSubmit={onSubmit}
className={classNames(styles.form, className)}
ref={ref}
>
{children}
</form>
);
2023-10-11 10:42:04 -04:00
},
2022-07-29 15:07:35 +02:00
);
Form.displayName = "Form";