import React, { Component } from 'react';
import { Select as ASelect } from 'antd';
import './index.less';

export default class Multiple extends Component {
  render() {
    const { select = [] } = this.props;
    return (
      <ASelect className="select-layout" mode="multiple" {...this.props}>
        {select.map((i, index) => {
          if (typeof i === 'string') {
            return (
              <ASelect.Option key={index} value={i}>
                {i}
              </ASelect.Option>
            );
          }
          return (
            <ASelect.Option key={index} value={i.value}>
              {i.name || i.title || i.label}
            </ASelect.Option>
          );
        })}
      </ASelect>
    );
  }
}
