/*
 * @Author: codingfly
 * @Description:
 * @Date: 2021-08-18 16:49:13
 * @LastEditTime: 2021-09-06 09:00:59
 * @FilePath: \young\components\dropdown\index.tsx
 */
import * as React from 'react';
import { View } from 'remax/one';
import { getPrefixCls } from './../common';
var prefixCls = getPrefixCls('dropdown');

var Dropdown = function Dropdown(props) {
  var _props$options = props.options,
      options = _props$options === void 0 ? [] : _props$options,
      value = props.value,
      _props$activeColor = props.activeColor,
      activeColor = _props$activeColor === void 0 ? '#1890FF' : _props$activeColor,
      onChange = props.onChange;
  return /*#__PURE__*/React.createElement(View, {
    className: prefixCls
  }, /*#__PURE__*/React.createElement(View, {
    className: "".concat(prefixCls, "-content")
  }, options.map(function (item) {
    return /*#__PURE__*/React.createElement(View, {
      className: "".concat(prefixCls, "-content-option"),
      key: item.value,
      onTap: function onTap() {
        return onChange === null || onChange === void 0 ? void 0 : onChange(item);
      },
      style: item.value === value ? {
        color: activeColor,
        fontWeight: 500
      } : undefined
    }, item.text);
  })));
};

export default Dropdown;