summaryrefslogtreecommitdiff
path: root/apps/web/lib/notify.ts
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/lib/notify.ts')
-rw-r--r--apps/web/lib/notify.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/web/lib/notify.ts b/apps/web/lib/notify.ts
new file mode 100644
index 0000000..911364f
--- /dev/null
+++ b/apps/web/lib/notify.ts
@@ -0,0 +1,11 @@
+import { toast } from "sonner"
+import { useNotificationStore } from "./stores/notification-store"
+
+export function notify(
+ message: string,
+ type: "info" | "success" | "error" = "info",
+ actionUrl?: string
+) {
+ toast(message)
+ useNotificationStore.getState().addNotification(message, type, actionUrl)
+}