remove old files

This commit is contained in:
Benjamin Canac
2024-03-27 12:39:55 +01:00
parent f3fec877c5
commit 85c693e3ba
150 changed files with 0 additions and 12276 deletions

View File

@@ -1,29 +0,0 @@
import type { Notification } from '../types/notification'
import { useState } from '#imports'
export function useToast () {
const notifications = useState<Notification[]>('notifications', () => [])
function add (notification: Partial<Notification>) {
const body = {
id: new Date().getTime().toString(),
...notification
}
const index = notifications.value.findIndex((n: Notification) => n.id === body.id)
if (index === -1) {
notifications.value.push(body as Notification)
}
return body
}
function remove (id: string) {
notifications.value = notifications.value.filter((n: Notification) => n.id !== id)
}
return {
add,
remove
}
}