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

22 lines
503 B
TypeScript
Raw Normal View History

2023-07-15 17:46:19 +03:00
import Card from './Card';
interface FormProps {
title: string
widthClass?: string
onSubmit: (event: React.FormEvent<HTMLFormElement>) => void
children: React.ReactNode
}
function Form({title, onSubmit, widthClass='max-w-xs', children}: FormProps) {
return (
<div className='flex flex-col items-center w-full'>
<Card title={title} widthClass={widthClass}>
<form onSubmit={onSubmit}>
{children}
</form>
</Card>
</div>
);
}
export default Form;