You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.tsx 598B

12345678910111213141516171819202122232425262728
  1. import { ExclamationCircleFilled } from '@ant-design/icons';
  2. import { Modal } from 'antd';
  3. const { confirm } = Modal;
  4. interface IProps {
  5. onOk?: (...args: any[]) => any;
  6. onCancel?: (...args: any[]) => any;
  7. }
  8. export const showDeleteConfirm = ({ onOk, onCancel }: IProps) => {
  9. confirm({
  10. title: 'Are you sure delete this item?',
  11. icon: <ExclamationCircleFilled />,
  12. content: 'Some descriptions',
  13. okText: 'Yes',
  14. okType: 'danger',
  15. cancelText: 'No',
  16. onOk() {
  17. onOk?.();
  18. },
  19. onCancel() {
  20. onCancel?.();
  21. },
  22. });
  23. };
  24. export default showDeleteConfirm;