import { NavigationType } from "../TemplateActionType"; /* eslint-disable @typescript-eslint/no-explicit-any */ const navigationHandlers = { [NavigationType.INTERNAL]: (path: string, actionInvokerProps: any) => actionInvokerProps.navigate(path), [NavigationType.EXTERNAL]: (path: string) => (window.location.href = path), [NavigationType.NEWWINDOW]: (path: string) => new Function(path)(), }; export const handleMenuNavigation = ( actionInvokerProps: any, path: string, navigationType: string ) => { const handler = navigationHandlers[navigationType as NavigationType]; if (handler) { handler(path, actionInvokerProps); } else { console.warn(`Unknown navigation type: ${navigationType}`); } };