Files
pterodactyl-panel/resources/scripts/components/form/Form.tsx
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

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>
);
}