import React, { useState } from 'react'; import { Button, Form, Input, Modal, Radio } from 'antd'; interface Values { title: string; description: string; modifier: string; } interface CollectionCreateFormProps { open: boolean; onCreate: (values: Values) => void; onCancel: () => void; } const CollectionCreateForm: React.FC = ({ open, onCreate, onCancel, }) => { const [form] = Form.useForm(); return ( { form .validateFields() .then((values) => { form.resetFields(); onCreate(values); }) .catch((info) => { console.log('Validate Failed:', info); }); }} >
Public Private
); }; const App: React.FC = () => { const [open, setOpen] = useState(false); const onCreate = (values: any) => { console.log('Received values of form: ', values); setOpen(false); }; return (
{ setOpen(false); }} />
); }; export default App;