website refactor
This commit is contained in:
29
apps/website/ui/Form.tsx
Normal file
29
apps/website/ui/Form.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import React, { ReactNode, FormEventHandler, forwardRef } from 'react';
|
||||
|
||||
export interface FormProps {
|
||||
children: ReactNode;
|
||||
onSubmit?: FormEventHandler<HTMLFormElement>;
|
||||
noValidate?: boolean;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const Form = forwardRef<HTMLFormElement, FormProps>(({
|
||||
children,
|
||||
onSubmit,
|
||||
noValidate = true,
|
||||
className
|
||||
}, ref) => {
|
||||
return (
|
||||
<form
|
||||
ref={ref}
|
||||
onSubmit={onSubmit}
|
||||
noValidate={noValidate}
|
||||
className={className}
|
||||
style={{ width: '100%' }}
|
||||
>
|
||||
{children}
|
||||
</form>
|
||||
);
|
||||
});
|
||||
|
||||
Form.displayName = 'Form';
|
||||
Reference in New Issue
Block a user