mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 21:10:38 +03:00
22 lines
503 B
TypeScript
22 lines
503 B
TypeScript
![]() |
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;
|