fix: api key table list sort

This commit is contained in:
jialin
2024-07-18 18:14:50 +08:00
parent 73d07faacf
commit 714e2d927a
10 changed files with 177 additions and 72 deletions
+26
View File
@@ -0,0 +1,26 @@
import { useIntl } from '@umijs/max';
import { Modal, message, type ModalFuncProps } from 'antd';
import { useRef } from 'react';
export default function useDeleteModal() {
const intl = useIntl();
const modalRef = useRef<any>();
const showDeleteModal = (config: ModalFuncProps = {}) => {
modalRef.current = Modal.confirm({
...config,
okText: intl.formatMessage({
id: 'common.button.delete'
}),
onCancel: () => {
config.onCancel?.();
modalRef.current.destroy?.();
},
onOk: async () => {
await config.onOk?.();
message.success(intl.formatMessage({ id: 'common.message.success' }));
}
});
};
return { showDeleteModal };
}