import React, { useContext } from 'react';
import Footer from '../wau-dropdown-footer';
import ConfigProvider from '../config-provider';
import './style';
import Popover from '../popover';
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,
    ...restProps
  } = props;
  const {
    getPrefixCls
  } = useContext(ConfigProvider.ConfigContext);
  const prefixCls = getPrefixCls('pro-core-field-dropdown');
  return /*#__PURE__*/_jsx(Popover, {
    trigger: ['click'],
    ...restProps,
    overlayInnerStyle: {
      padding: 0
    },
    overlayClassName: `${prefixCls}-overlay-wrapper`,
    open: visible,
    onOpenChange: onVisibleChange,
    content: /*#__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;