import { Button, Form, Input, Switch } from 'antd'; import { Controller, useForm } from 'react-hook-form'; import { useHistory } from 'react-router-dom'; import { createBill } from '../api'; import { InputSelect } from '../components/inputSelect'; import { withLayout } from '../layouts/main'; import { BillForm } from '../types/bill'; const HomePage = () => { // Hooks const { register, handleSubmit, control } = useForm(); const history = useHistory(); // Logic const onSubmit = handleSubmit(async (data) => { const newId = await createBill(data); history.push(`/bills/${newId}`); }); return (

Create a new bill

{ const { value, ...props } = field; return ( ); }} />
); }; export default withLayout(HomePage);