2282 Rename components to use the new naming convention part 3 (#2296)
part 3 of the renaming
This commit is contained in:
18
front/src/modules/metadata/hooks/useObjectMetadataItem.ts
Normal file
18
front/src/modules/metadata/hooks/useObjectMetadataItem.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { useAvailableScopeIdOrThrow } from '@/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId';
|
||||
|
||||
import { ObjectMetadataItemScopeInternalContext } from '../scopes/scope-internal-context/ObjectMetadataItemScopeInternalContext';
|
||||
|
||||
type UseObjectMetadataItemProps = {
|
||||
objectMetadataItemNamePlural?: string;
|
||||
};
|
||||
|
||||
export const useObjectMetadataItem = (props?: UseObjectMetadataItemProps) => {
|
||||
const scopeId = useAvailableScopeIdOrThrow(
|
||||
ObjectMetadataItemScopeInternalContext,
|
||||
props?.objectMetadataItemNamePlural,
|
||||
);
|
||||
|
||||
return {
|
||||
scopeId,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user