import { Form, Spin } from 'antd';
import { memo, useEffect } from 'react';
import CustomCheckboxGroup from '../CustomCheckboxGroup';
const PolicyStep = ({
  show,
  policyInitFetch,
  policyLoading,
  policyAllData,
  isHaveDate,
  policyList,
}) => {
  useEffect(() => {
    if (show) {
      policyInitFetch();
    }
  }, [show]);
  return (
    <Spin spinning={policyLoading}>
      <Form.Item name="policies">
        <CustomCheckboxGroup options={policyAllData} isHaveDate={isHaveDate} oldData={policyList} />
      </Form.Item>
    </Spin>
  );
};
export default memo(PolicyStep);
