You've already forked agentic-coding-workflow
28 lines
601 B
TypeScript
28 lines
601 B
TypeScript
import { defineStore } from 'pinia'
|
|
import { ref } from 'vue'
|
|
|
|
export interface Notification {
|
|
id: string
|
|
topic: string
|
|
severity: 'info' | 'warning' | 'error'
|
|
title: string
|
|
body: string
|
|
link?: string
|
|
read_at?: string
|
|
created_at: string
|
|
}
|
|
|
|
export const useNotificationsStore = defineStore('notifications', () => {
|
|
const items = ref<Notification[]>([])
|
|
const unreadCount = ref(0)
|
|
|
|
function setItems(list: Notification[]) {
|
|
items.value = list
|
|
}
|
|
function setUnreadCount(n: number) {
|
|
unreadCount.value = n
|
|
}
|
|
|
|
return { items, unreadCount, setItems, setUnreadCount }
|
|
})
|