♻️ refactor: useConfirmModal composable updated

This commit is contained in:
Paul Valerie GOMA 2025-08-03 04:28:31 +02:00
parent ef57a78a03
commit dc288d42bb

View File

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