ConceptPortal-public/rsconcept/frontend/src/components/Common/Form.tsx

21 lines
511 B
TypeScript
Raw Normal View History

2023-07-15 17:46:19 +03:00
interface FormProps {
2023-11-05 18:41:28 +03:00
title?: string
dimensions?: string
2023-07-15 17:46:19 +03:00
onSubmit: (event: React.FormEvent<HTMLFormElement>) => void
children: React.ReactNode
}
function Form({ title, onSubmit, dimensions = 'max-w-xs', children }: FormProps) {
2023-07-15 17:46:19 +03:00
return (
<form
className={`border shadow-md py-2 clr-app px-6 flex flex-col gap-3 ${dimensions}`}
onSubmit={onSubmit}
>
2023-10-14 17:14:40 +03:00
{ title && <h1 className='text-xl whitespace-nowrap'>{title}</h1> }
{children}
</form>
2023-07-15 17:46:19 +03:00
);
}
2023-07-25 20:27:29 +03:00
export default Form;