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

class TagLayout extends Component {
  onClick(tab) {
    if (this.props.onChange) this.props.onChange(tab);
  }

  getItem(item) {
    return <Tag>{item.name}</Tag>;
  }

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

export default TagLayout;
