import { notifications } from "@mantine/notifications"; type CustomNotifications = { notify: (...params: Parameters) => void; success: (...params: Parameters) => void; warn: (...params: Parameters) => void; error: (...params: Parameters) => void; guess: ( ok: boolean, ...params: Parameters ) => void; } & typeof notifications; const customNotifications: CustomNotifications = { ...notifications, notify: params => { return notifications.show({ ...params, color: "blue", }); }, success: params => { return notifications.show({ ...params, color: "green", }); }, warn: params => { return notifications.show({ ...params, color: "yellow", }); }, error: params => { return notifications.show({ ...params, color: "red", }); }, guess: (ok: boolean, params) => { if (ok) return customNotifications.success(params); return customNotifications.error(params); }, }; export { customNotifications as notifications };