import React from 'react';
import Invoice from '../../..';
import 'antd/dist/antd.css';

export default () => {

    const controller = React.useMemo(() => new Invoice.InvoiceController(), []);

    React.useEffect(() => {
        (async () => {

            await controller.run(async s => {
                s.stakeholder.disableds = [
                    'buyerName',
                    'buyerTaxId',
                    'remark',
                    'itemModelName',
                    'unit',
                ]
            })

            controller.formList.get('stakeholder')?.setFieldsValue({
                buyerName: 'buyerName',
                buyerTaxId: 'buyerTaxId',
            })

            controller.formList.get('sign')?.setFieldsValue({
                remark: 'remark',
            })
        })()

    }, [controller])

    return (
        <Invoice
            invoiceType='digtal'
            controller={controller}
        />
    )
};
