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

const Dropdown = ({
  options,
  value,
  onChange,
  languageData
}) => {
  if (!options || options.length === 0) return null;
  console.log('languageData Dropdown =>', languageData);
  return /*#__PURE__*/React.createElement(Select, {
    value: typeof value === 'object' ? value && value.assetId : value,
    onChange: onChange,
    style: {
      minWidth: '160px'
    }
  }, options.map(({
    label,
    value: val
  }, i) => /*#__PURE__*/React.createElement(Select.Option, {
    key: i,
    value: val
  }, languageData && Object.entries(languageData).length !== 0 && languageData[label] ? languageData[label] : label)));
};

export default Dropdown;