2023-12-07 10:13:09 -08:00
|
|
|
import { useMemo } from 'react';
|
2025-04-16 16:55:38 -07:00
|
|
|
|
|
|
|
import buildEntityRegistry from '@app/buildEntityRegistry';
|
|
|
|
import buildEntityRegistryV2 from '@app/buildEntityRegistryV2';
|
|
|
|
import { useIsThemeV2 } from '@app/useIsThemeV2';
|
2023-12-07 10:13:09 -08:00
|
|
|
|
|
|
|
export default function useBuildEntityRegistry() {
|
2025-01-29 20:42:01 -05:00
|
|
|
const isThemeV2Enabled = useIsThemeV2();
|
2023-12-07 10:13:09 -08:00
|
|
|
return useMemo(() => {
|
2025-01-29 20:42:01 -05:00
|
|
|
return isThemeV2Enabled ? buildEntityRegistryV2() : buildEntityRegistry();
|
|
|
|
}, [isThemeV2Enabled]);
|
2023-12-07 10:13:09 -08:00
|
|
|
}
|