♻️ refactor: useConfirmModal composable updated

This commit is contained in:
Paul Valerie GOMA 2025-07-31 11:10:18 +02:00
parent 5f8a7ae4c2
commit 2dda891c43

View File

@ -3,8 +3,6 @@ import { useConfirm } from "primevue";
import VButton from "../button/VButton.vue";
export function useConfirmModal() {
const confirm = useConfirm();
const showConfirmModal = ({
acceptProps = VButton,
rejectProps = VButton,
@ -12,15 +10,17 @@ export function useConfirmModal() {
header = '',
message = '',
icon = '',
accept = Function,
reject = Function,
onHide = Function,
onShow = Function,
accept = () => {},
reject = () => {},
onHide = () => {},
onShow = () => {},
modal = true,
blockScroll = true,
position = 'center',
appendTo = 'body',
}: ConfirmationOptions) => {
const confirm = useConfirm();
confirm.require({
group,
header,
@ -36,7 +36,9 @@ export function useConfirmModal() {
blockScroll,
position,
appendTo,
})
}
return {showConfirmModal}
});
};
return { showConfirmModal };
}