2025-01-29 20:42:01 -05:00
|
|
|
import buildEntityRegistryV2 from '@app/buildEntityRegistryV2';
|
2023-12-07 10:13:09 -08:00
|
|
|
import React from 'react';
|
|
|
|
import { EntityRegistryContext } from '../entityRegistryContext';
|
2025-01-29 20:42:01 -05:00
|
|
|
import EntityRegistry from './entity/EntityRegistry';
|
2023-12-07 10:13:09 -08:00
|
|
|
import useBuildEntityRegistry from './useBuildEntityRegistry';
|
|
|
|
|
2025-01-29 20:42:01 -05:00
|
|
|
export const globalEntityRegistryV2 = buildEntityRegistryV2();
|
|
|
|
|
2023-12-07 10:13:09 -08:00
|
|
|
const EntityRegistryProvider = ({ children }: { children: React.ReactNode }) => {
|
2025-01-29 20:42:01 -05:00
|
|
|
const entityRegistry = useBuildEntityRegistry() as EntityRegistry;
|
2023-12-07 10:13:09 -08:00
|
|
|
return <EntityRegistryContext.Provider value={entityRegistry}>{children}</EntityRegistryContext.Provider>;
|
|
|
|
};
|
|
|
|
|
|
|
|
export default EntityRegistryProvider;
|