24 lines
605 B
TypeScript
24 lines
605 B
TypeScript
import React from 'react';
|
|
import { Popconfirm } from 'antd';
|
|
import styles from './index.less';
|
|
import classNames from 'classnames';
|
|
|
|
interface PropsType {
|
|
onDelete: () => void;
|
|
disabled?: boolean;
|
|
}
|
|
const DeleteButton: React.FC<PropsType> = ({ onDelete, disabled = false }) => {
|
|
return (
|
|
<Popconfirm
|
|
title="是否确认删除当前项?"
|
|
disabled={disabled}
|
|
onConfirm={onDelete}
|
|
okText="是"
|
|
cancelText="否"
|
|
>
|
|
<a className={classNames(styles.deleteBtn, disabled ? styles.disabled : '')}>删除</a>
|
|
</Popconfirm>
|
|
);
|
|
};
|
|
export default DeleteButton;
|