From ef57a78a0324efddc16af4b95f7f1b8a02796a30 Mon Sep 17 00:00:00 2001 From: Paul Valerie GOMA Date: Sun, 3 Aug 2025 04:28:04 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=20refactor:=20useAlert=20?= =?UTF-8?q?composable=20updated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/composable/useAlert.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/composable/useAlert.ts b/src/components/composable/useAlert.ts index 0d21486..aff6d2b 100644 --- a/src/components/composable/useAlert.ts +++ b/src/components/composable/useAlert.ts @@ -1,25 +1,24 @@ import { useToast } from "primevue/usetoast"; -import type IVAlert from "@/components/alert/IVAlert.type.js"; +import type IVAlert from "../alert/IVAlert.type.js"; export function useAlert() { + const toast = useToast(); + const showAlert = ({ title = '', description = '', type = 'info', closeable = true, lifeTime, - }: IVAlert) => { - const toast = useToast(); - + }: IVAlert) => { toast.add({ severity: type, summary: title, detail: description, life: lifeTime, closable: closeable, - }); - }; + }) + } - return { showAlert }; + return { showAlert} } -