Files
twenty_crm/front/src/modules/metadata/hooks/useObjectMetadataItem.ts
2023-10-31 12:38:53 +01:00

19 lines
577 B
TypeScript

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,
};
};