import React from 'react';
import { Popconfirm } from 'antd';
import styles from './index.less';
import classNames from 'classnames';

interface PropsType {
  onConfirm: () => void;
  title?: string;
  buttonName?: string;
  disabled?: boolean;
}
const ConfirmButton: React.FC<PropsType> = ({
  onConfirm,
  disabled = false,
  title = '',
  buttonName = '',
}) => {
  return (
    <Popconfirm title={title} disabled={disabled} onConfirm={onConfirm} okText="是" cancelText="否">
      <a className={classNames(styles.rejectBtn, disabled ? styles.disabled : '')}>{buttonName}</a>
    </Popconfirm>
  );
};
export default ConfirmButton;
