mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
Added types file for notifications store
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user