import React from 'react';
import { Select } from 'antd';

const { Option } = Select;

function DDMultiSelectField(props) {
  const { options, disabled, onChange } = props;

  return (
    <Select
      mode="multiple"
      allowClear
      style={{ width: '100%' }}
      disabled={disabled}
      onChange={value => {
        onChange(value);
      }}
    >
      {options?.map(cur => {
        return (
          <Option key={cur} value={cur}>
            {cur}
          </Option>
        );
      })}
    </Select>
  );
}

export default DDMultiSelectField;
