Добавлен сервис уведомлений

This commit is contained in:
brusnitsyn
2025-12-19 09:19:41 +09:00
parent b86cdaec90
commit 9057d3e8ad
3 changed files with 65 additions and 6 deletions

View File

@@ -0,0 +1,30 @@
export function useNotification() {
const showNotification = (options) => {
if (window.$notification) {
return window.$notification.create(options)
}
return null
}
const success = () => {
}
const errorApi = (content = '', options = {}) => {
return showNotification(
{
title: 'Произошла ошибка',
description: 'При обращении к API серверу',
content,
meta: options.meta || new Date().toLocaleDateString(),
...options,
type: 'error'
}
)
}
return {
errorApi
}
}