import _find from "lodash/fp/find";
import React from 'react';
import PropTypes from 'prop-types';
import Select, { SelectOptionPropTypes } from '../../../atom/select';
import style from './style.css';
const DropDown = props => {
  const {
    options,
    onChange,
    theme: propsTheme,
    'aria-label': ariaLabel,
    groupAriaLabel
  } = props;
  const currentSelection = _find('selected', options);
  const defaultTheme = !currentSelection || currentSelection.validOption === false ? 'invalid' : 'question';
  const theme = propsTheme || defaultTheme;
  return /*#__PURE__*/React.createElement("div", {
    className: style.wrapper,
    role: "group",
    "aria-label": groupAriaLabel
  }, /*#__PURE__*/React.createElement(Select, {
    "aria-label": ariaLabel,
    theme: theme,
    options: options,
    onChange: onChange
  }));
};
DropDown.propTypes = process.env.NODE_ENV !== "production" ? {
  onChange: Select.propTypes.onChange,
  options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),
  theme: Select.propTypes.theme,
  'aria-label': PropTypes.string,
  groupAriaLabel: PropTypes.string
} : {};
export default DropDown;
//# sourceMappingURL=index.js.map