2023-12-07 10:13:09 -08:00
|
|
|
import React from 'react';
|
2025-04-16 16:55:38 -07:00
|
|
|
|
|
|
|
|
import buildEntityRegistryV2 from '@app/buildEntityRegistryV2';
|
|
|
|
|
import EntityRegistry from '@app/entity/EntityRegistry';
|
|
|
|
|
import useBuildEntityRegistry from '@app/useBuildEntityRegistry';
|
|
|
|
|
import { EntityRegistryContext } from '@src/entityRegistryContext';
|
2023-12-07 10:13:09 -08:00
|
|
|
|
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;
|