first commit

This commit is contained in:
brusnitsyn
2026-06-24 17:20:43 +09:00
commit 43499acf1c
165 changed files with 25929 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
import type { NotificationOptions } from 'naive-ui';
/**
* Обёртка над discrete notification API NaiveUI с удобными хелперами.
* Перенесено и упрощено из проекта onboard (Composables/useNotification.js).
*/
export function useNotification() {
const showNotification = (options: NotificationOptions) => {
return window.$notification?.create(options) ?? null;
};
const success = (
title: string,
description = '',
options: Partial<NotificationOptions> = {},
) => {
return showNotification({
title,
description,
meta: options.meta ?? new Date().toLocaleDateString(),
...options,
type: 'success',
});
};
const error = (
title = 'Произошла ошибка',
description = '',
options: Partial<NotificationOptions> = {},
) => {
return showNotification({
title,
description,
meta: options.meta ?? new Date().toLocaleDateString(),
...options,
type: 'error',
});
};
return { success, error };
}