import { useState, useEffect } from 'react';
import { connect } from '@umijs/max';
import { ConfigProvider } from 'antd';
import PagesMainJobseekerAccountTable from '@/components/Render/Main/Jobseeker/Account/table'
import PagesMainJobseekerAccountCreate from '@/components/Render/Main/Jobseeker/Account/create'


const JobseekerAccountPage: React.FC = ({ dispatch, openModel }: any) => {
    const [id, setId] = useState<object>(null);
    const getId = (value: number) => {
        setId(value)
    }

    useEffect(() => {
        if (!openModel.openModal) {
            setId(0)
        }
    }, [openModel.openModal])

    return (
        <>
            <ConfigProvider
                theme={{
                    token: {
                        colorPrimary: '#4FBE70',
                    }
                }}
            >
                <PagesMainJobseekerAccountTable getId={getId}></PagesMainJobseekerAccountTable>
                <PagesMainJobseekerAccountCreate id={id}></PagesMainJobseekerAccountCreate>

            </ConfigProvider>
        </>
    );
};


export default connect(({ openModel }: any) => ({
    openModel
}))(JobseekerAccountPage);