Added types file for notifications store

This commit is contained in:
Emir Karabeg
2025-01-17 16:30:37 -08:00
parent 232c453147
commit 56407f7b42
2 changed files with 19 additions and 19 deletions
+1 -19
View File
@@ -1,24 +1,6 @@
import { create } from 'zustand'
import { devtools } from 'zustand/middleware'
export type NotificationType = 'error' | 'console'
export interface Notification {
id: string
type: NotificationType
message: string
timestamp: number
isVisible: boolean
}
interface NotificationStore {
notifications: Notification[]
addNotification: (type: NotificationType, message: string) => void
hideNotification: (id: string) => void
showNotification: (id: string) => void
removeNotification: (id: string) => void
clearNotifications: () => void
}
import { NotificationType, Notification, NotificationStore } from './types'
export const useNotificationStore = create<NotificationStore>()(
devtools(
+18
View File
@@ -0,0 +1,18 @@
export type NotificationType = 'error' | 'console'
export interface Notification {
id: string
type: NotificationType
message: string
timestamp: number
isVisible: boolean
}
export interface NotificationStore {
notifications: Notification[]
addNotification: (type: NotificationType, message: string) => void
hideNotification: (id: string) => void
showNotification: (id: string) => void
removeNotification: (id: string) => void
clearNotifications: () => void
}