feature/IO-3725-RPS-Changes - Deprecations / Bug fixes

This commit is contained in:
Dave
2026-05-28 14:24:06 -04:00
parent 562adaa795
commit 3017619565

24
src/util/antdFeedback.js Normal file
View File

@@ -0,0 +1,24 @@
import { message as staticMessage, notification as staticNotification } from "antd";
let messageApi = staticMessage;
let notificationApi = staticNotification;
const createApiProxy = (getApi) =>
new Proxy(
{},
{
get(_target, prop) {
const api = getApi();
const value = api[prop];
return typeof value === "function" ? value.bind(api) : value;
}
}
);
export const configureAntdFeedback = ({ message, notification }) => {
if (message) messageApi = message;
if (notification) notificationApi = notification;
};
export const antdMessage = createApiProxy(() => messageApi);
export const antdNotification = createApiProxy(() => notificationApi);