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

const { Option } = Select;

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

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

export default DDSelectField;
