Files
usda-vision/management-dashboard-web-app/src/lib/loadRemote.tsx
salirezav 36b9ca6525 Refactor video streaming feature and update dependencies
- Replaced npm ci with npm install in docker-compose for better package management.
- Introduced remote component loading for the VideoStreamingPage with error handling.
- Updated the title in index.html to "Experiments Dashboard" for clarity.
- Added new video remote service configuration in docker-compose for improved integration.
- Removed deprecated files and components related to the video streaming feature to streamline the codebase.
- Updated package.json and package-lock.json to include @originjs/vite-plugin-federation for module federation support.
2025-10-30 15:36:19 -04:00

15 lines
251 B
TypeScript

import React from 'react'
export function loadRemoteComponent<T>(
enabled: boolean,
remoteImport: () => Promise<{ default: T }>,
localComponent: T
): T {
if (enabled) {
return React.lazy(remoteImport) as T
}
return localComponent
}