import React, { useContext } from 'react';
import { useIntl } from '../wau-provider';
import Button from '../button';
import ConfigProvider from '../config-provider';
import './style';
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
const DropdownFooter = props => {
  const intl = useIntl();
  const {
    onClear,
    onConfirm,
    disabled
  } = props;
  const {
    getPrefixCls
  } = useContext(ConfigProvider.ConfigContext);
  const prefixCls = getPrefixCls('pro-core-dropdown-footer');
  return /*#__PURE__*/_jsxs("div", {
    className: prefixCls,
    onClick: e => e.target.getAttribute('data-type') !== 'confirm' && e.stopPropagation(),
    children: [/*#__PURE__*/_jsx(Button, {
      style: {
        visibility: onClear ? 'visible' : 'hidden'
      },
      type: "link",
      size: "small",
      disabled: disabled,
      onClick: e => {
        if (onClear) {
          onClear(e);
        }
        e.stopPropagation();
      },
      children: intl.getMessage('form.lightFilter.clear', '清除')
    }), /*#__PURE__*/_jsx(Button, {
      "data-type": "confirm",
      type: "primary",
      size: "small",
      onClick: onConfirm,
      disabled: disabled,
      children: intl.getMessage('form.lightFilter.confirm', '确认')
    })]
  });
};
export default DropdownFooter;