import React, { useState, useEffect } from 'react';
import { Card, Steps } from 'antd';
import { PageContainer } from '@ant-design/pro-layout';
import { connect } from 'umi';
import Step1 from './components/Step1';
import Step2 from './components/Step2';
import styles from './style.less';
const { Step } = Steps;
const getCurrentStepAndComponent = (current) => {
switch (current) {
case 'detail':
return {
step: 1,
component: ,
};
case 'info':
default:
return {
step: 0,
component: ,
};
}
};
const EditReport = ({ current }) => {
const [stepComponent, setStepComponent] = useState();
const [currentStep, setCurrentStep] = useState(0);
useEffect(() => {
const { step, component } = getCurrentStepAndComponent(current);
setCurrentStep(step);
setStepComponent(component);
}, [current]);
console.log(stepComponent)
return (
<>
{stepComponent}
>
);
};
export default connect(({ editReport }) => ({
current: editReport.current,
}))(EditReport);