import React from 'react';
import { ColumnHeightOutlined } from '@ant-design/icons';
import Button from '../button';
import Dropdown from '../dropdown';
import Tooltip from '../tooltip';
import { useIntl } from '../wau-provider';
import Container from './container';
import { jsx as _jsx } from "react/jsx-runtime";
const DensityIcon = () => {
  // eslint-disable-next-line
  const counter = Container.useContainer();
  const intl = useIntl();
  return /*#__PURE__*/_jsx(Dropdown, {
    menu: {
      items: [{
        key: 'large',
        title: intl.getMessage('tableToolBar.densityLarger', '默认'),
        label: intl.getMessage('tableToolBar.densityLarger', '默认')
      }, {
        key: 'middle',
        title: intl.getMessage('tableToolBar.densityMiddle', '中等'),
        label: intl.getMessage('tableToolBar.densityMiddle', '中等')
      }, {
        key: 'small',
        title: intl.getMessage('tableToolBar.densitySmall', '紧凑'),
        label: intl.getMessage('tableToolBar.densitySmall', '紧凑')
      }],
      selectedKeys: [counter.tableSize],
      onClick: ({
        key
      }) => {
        if (counter.setTableSize) {
          counter.setTableSize(key);
        }
      },
      style: {
        width: 80
      }
    },
    trigger: ['click'],
    children: /*#__PURE__*/_jsx(Tooltip, {
      title: intl.getMessage('tableToolBar.density', '表格密度'),
      children: /*#__PURE__*/_jsx(Button, {
        icon: /*#__PURE__*/_jsx(ColumnHeightOutlined, {})
      })
    })
  });
};
export default /*#__PURE__*/React.memo(DensityIcon);