import React, { useMemo } from 'react';
import { Dropdown, Button } from '@pisell/materials';
var MoreDropdown = function MoreDropdown(props) {
  var locales = props.locales,
    _onClick = props.onClick,
    buttonText = props.buttonText,
    _props$showFields = props.showFields,
    showFields = _props$showFields === void 0 ? ['missing', 'broken'] : _props$showFields;
  var menuItems = useMemo(function () {
    return [{
      key: 'missing',
      label: locales.getText('pisell2.text.ecocup.action.more.missing'),
      hidden: !showFields.includes('missing')
    }, {
      key: 'broken',
      label: locales.getText('pisell2.text.ecocup.action.more.broken'),
      hidden: !showFields.includes('broken')
    }];
  }, [locales, showFields]);
  return /*#__PURE__*/React.createElement(Dropdown, {
    trigger: ['click', 'hover'],
    menu: {
      items: menuItems.filter(function (item) {
        return !item.hidden;
      }),
      onClick: function onClick(item) {
        console.log(item, item.key, '---Dropdown');
        _onClick && _onClick(item.key);
      }
    }
  }, /*#__PURE__*/React.createElement(Button, null, buttonText || locales.getText('pisell2.text.ecocup.action.more')));
};
export default MoreDropdown;