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