import React, { Component } from 'react';
import { Steps } from 'antd';
import './index.less';

class StepLayout extends Component {
  getItem(item) {
    return <Steps.Step title={item.name} description={item.desc || false} />;
  }

  render() {
    const { itemList = [], step = 0 } = this.props;
    return (
      <div className="step-layout">
        <Steps current={step}>
          {itemList.map(item => {
            return this.getItem(item);
          })}
        </Steps>
      </div>
    );
  }
}

export default StepLayout;
