import React, { useContext } from 'react';
import Footer from '../wau-dropdown-footer';
import Dropdown from '../dropdown';
import ConfigProvider from '../config-provider';
import './style';
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
const FilterDropdown = props => {
  const {
    children,
    label,
    footer,
    disabled,
    onVisibleChange,
    visible
  } = props;
  const {
    getPrefixCls
  } = useContext(ConfigProvider.ConfigContext);
  const prefixCls = getPrefixCls('pro-core-field-dropdown');
  return /*#__PURE__*/_jsx(Dropdown, {
    disabled: disabled,
    trigger: ['click'],
    visible: visible,
    onVisibleChange: onVisibleChange,
    overlay: /*#__PURE__*/_jsxs("div", {
      className: `${prefixCls}-overlay`,
      children: [/*#__PURE__*/_jsx("div", {
        className: `${prefixCls}-content`,
        children: children
      }), footer && /*#__PURE__*/_jsx(Footer, {
        disabled: disabled,
        ...footer
      })]
    }),
    children: /*#__PURE__*/_jsx("span", {
      className: `${prefixCls}-label`,
      children: label
    })
  });
};
export default FilterDropdown;