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

23 lines
508 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
}
2023-07-25 20:27:29 +03:00
function Form({ title, onSubmit, widthClass = 'max-w-xs', children }: FormProps) {
2023-07-15 17:46:19 +03:00
return (
<div className='flex flex-col items-center w-full'>
<Card title={title} widthClass={widthClass}>
<form onSubmit={onSubmit}>
{children}
</form>
</Card>
</div>
);
}
2023-07-25 20:27:29 +03:00
export default Form;