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

38 lines
762 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 OR LicenseRef-Element-Commercial
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 {
type FC,
type Ref,
type FormEventHandler,
type 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 {
ref?: Ref<HTMLFormElement>;
2022-07-29 15:07:35 +02:00
className: string;
onSubmit: FormEventHandler<HTMLFormElement>;
children: ReactNode[];
2022-07-29 15:07:35 +02:00
}
export const Form: FC<FormProps> = ({ ref, children, className, onSubmit }) => {
return (
<form
onSubmit={onSubmit}
className={classNames(styles.form, className)}
ref={ref}
>
{children}
</form>
);
};
Form.displayName = "Form";