
import { useState, useEffect } from 'react';
import { connect } from '@umijs/max';

import { ConfigProvider, Modal, Tabs } from 'antd';

import FormJobseekerHelpRecommend from '../resume/help/recommend';
import FormJobseekerHelpAssist from '../resume/help/assist';


const PagesMainJobseekerListHelp: React.FC = ({ dispatch, dictModel, openModel, id }: any) => {
    const [openPreview, setOpenPreview] = useState(false);

    useEffect(() => {
        setOpenPreview(openModel.openResumeHelpModal)
    }, [openModel.openResumeHelpModal])


    return (
        <>
            <ConfigProvider
                theme={{
                    token: {
                        colorPrimary: '#4FBE70',
                    }
                }}
            >
                <Modal
                    open={openPreview}
                    title='工作帮扶情况'
                    centered
                    maskClosable={false}
                    footer={null}
                    destroyOnClose
                    width={1000}
                    onCancel={() => {
                        dispatch({ type: 'openModel/getOpenResumeHelpModal', payload: false })
                    }}
                >
                    <Tabs
                        destroyInactiveTabPane={true}
                        type="card"
                        items={[
                            {
                                label: '介绍工作情况',
                                key: '1',
                                children: (
                                    <>
                                        <FormJobseekerHelpRecommend id={id}></FormJobseekerHelpRecommend>
                                    </>
                                ),
                            },
                            {
                                label: '帮扶情况',
                                key: '2',
                                children: (
                                    <>
                                        <FormJobseekerHelpAssist id={id}></FormJobseekerHelpAssist>
                                    </>
                                ),
                            }
                        ]}
                    >

                    </Tabs>

                </Modal>
            </ConfigProvider >
        </>
    );
};



export default connect(({ dictModel, openModel }: any) => ({
    dictModel, openModel
}))(PagesMainJobseekerListHelp);