import { Notify } from "quasar"; export function quasarNotify({ message = "", type, timeout = 1000 }) { const obj = { success: () => Notify.create({ message, color: "positive", position: "top", icon: "check_circle", timeout, }), warning: () => Notify.create({ message, color: "warning", position: "top", icon: "report_problem", timeout, }), erro: () => Notify.create({ message, color: "negative", position: "top", icon: "report_problem", timeout, }), info: () => Notify.create({ message, color: "info", position: "top", icon: "info", timeout, }), default: () => { console.error(`Type is invalid! TYPE: ${type}`) } }; if (type) { return obj[type]() || obj['default'](); } console.error("Type is required, success, warning or erro"); }