import { Button as AntdButton } from 'antd';
import _ from 'lodash';
import React, { useMemo } from 'react';
import styles from './index.module.css';
const Button = (param) => {
    const { children, width, onClick } = param;
    const others = _.omit(param, ['children', 'onClick', 'width', 'style', 'className']);
    const onClickThrottle = useMemo(() => _.debounce((e) => {
        if (onClick)
            onClick(e);
    }, 600, { leading: true, trailing: false }), [onClick]);
    return (<AntdButton style={{
            width,
            ...param.style,
        }} className={`${styles.button} ${param.className}`} onClick={(e) => onClickThrottle(e)} {...others}>
      {children}
    </AntdButton>);
};
export default Button;
//# sourceMappingURL=index.jsx.map