import { Form, Spin } from 'antd';
import { memo, useEffect } from 'react';
import CustomTree from '../CustomTree';

const FeatureStep = ({ initFetch, show, isHaveDate, loading, list, featureTreeData }) => {
  useEffect(() => {
    if (show) {
      initFetch();
    }
  }, [show]);
  return (
    <Spin spinning={loading}>
      <Form.Item name="features">
        <CustomTree
          type="feature"
          oldData={list}
          treeData={featureTreeData}
          isHaveDate={isHaveDate}
        />
      </Form.Item>
    </Spin>
  );
};

export default memo(FeatureStep);
