diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-10-10 22:45:28 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-10-10 22:45:28 +0530 |
commit | 0b4343bed2cace86552929f25202680c0d99c541 (patch) | |
tree | f5eb25902a401ff98827aed68377c7f221097f75 /src/views | |
parent | 6dd449f6f38e8afdee7638b56f24e61953854eda (diff) |
added ItemTable for the invoice page
Diffstat (limited to 'src/views')
-rw-r--r-- | src/views/invoice/new.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/views/invoice/new.js b/src/views/invoice/new.js index 57f3094..70bc545 100644 --- a/src/views/invoice/new.js +++ b/src/views/invoice/new.js @@ -17,6 +17,7 @@ import ClientPicker from '../../components/pickers/client-picker'; import ItemPicker from '../../components/pickers/item-picker'; +import ItemTable from '../../components/tables/invoice-item-table'; import { InvoiceClient } from '../../classes/client'; @@ -25,6 +26,7 @@ import { useState, useEffect } from 'react'; const NewInvoicePage = () => { const [client, setClient] = useState(new InvoiceClient()); const [shippingAddressId, setShippingAddressId] = useState(-1); + const [items, setItems] = useState([]); useEffect(() => { setShippingAddressId(-1); @@ -37,7 +39,12 @@ const NewInvoicePage = () => { setClient={setClient} shippingAddressId={shippingAddressId} setShippingAddressId={setShippingAddressId}/> - <ItemPicker/> + <ItemPicker + invoiceItems={items} + addInvoiceItem={(item) => setItems(prev => [...prev, item])} /> + <ItemTable + items={items} + setItems={setItems} /> </> ); } |