mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
21 lines
511 B
TypeScript
21 lines
511 B
TypeScript
interface FormProps {
|
|
title?: string
|
|
dimensions?: string
|
|
onSubmit: (event: React.FormEvent<HTMLFormElement>) => void
|
|
children: React.ReactNode
|
|
}
|
|
|
|
function Form({ title, onSubmit, dimensions = 'max-w-xs', children }: FormProps) {
|
|
return (
|
|
<form
|
|
className={`border shadow-md py-2 clr-app px-6 flex flex-col gap-3 ${dimensions}`}
|
|
onSubmit={onSubmit}
|
|
>
|
|
{ title && <h1 className='text-xl whitespace-nowrap'>{title}</h1> }
|
|
{children}
|
|
</form>
|
|
);
|
|
}
|
|
|
|
export default Form;
|