2023-11-20 17:58:41 +00:00
|
|
|
import { Notify } from 'quasar';
|
|
|
|
import { i18n } from 'src/boot/i18n';
|
|
|
|
|
|
|
|
export default function useNotify() {
|
2023-11-28 13:11:24 +00:00
|
|
|
const notify = (message, type, icon) => {
|
|
|
|
const defaultIcons = {
|
|
|
|
warning: 'warning',
|
|
|
|
negative: 'error',
|
|
|
|
positive: 'check',
|
|
|
|
};
|
|
|
|
|
2023-11-20 17:58:41 +00:00
|
|
|
Notify.create({
|
|
|
|
message: i18n.global.t(message),
|
|
|
|
type: type,
|
2023-11-28 13:11:24 +00:00
|
|
|
icon: icon ? icon : defaultIcons[type],
|
2023-11-20 17:58:41 +00:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
return {
|
|
|
|
notify,
|
|
|
|
};
|
|
|
|
}
|