mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-30 11:25:52 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
23 lines
563 B
TypeScript
23 lines
563 B
TypeScript
import React from 'react';
|
|
|
|
interface Props extends Omit<React.FormHTMLAttributes<HTMLFormElement>, 'onSubmit'> {
|
|
form: { handleSubmit: () => unknown };
|
|
children: React.ReactNode;
|
|
}
|
|
|
|
export default function Form({ form, children, ...props }: Props) {
|
|
return (
|
|
<form
|
|
noValidate
|
|
{...props}
|
|
onSubmit={(event) => {
|
|
event.preventDefault();
|
|
event.stopPropagation();
|
|
void form.handleSubmit();
|
|
}}
|
|
>
|
|
{children}
|
|
</form>
|
|
);
|
|
}
|