Add alpine notifications plugin

This commit is contained in:
klmp200 committed 2025-09-26 14:54:26 +02:00
1 parent f015bde768
commit ca50e5dc81
2 files changed
+13

No files matched your search

@@ -23,3 +23,14 @@ export function deleteNotifications() {
}
return element.dispatchEvent(new CustomEvent("quick-notification-delete"));
}
export function alpinePlugin() {
return {
error: (message: string) => createNotification(message, NotificationLevel.Error),
warning: (message: string) =>
createNotification(message, NotificationLevel.Warning),
success: (message: string) =>
createNotification(message, NotificationLevel.Success),
clear: () => deleteNotifications(),
};
}