Files
twenty_crm/front/src/modules/metadata/scopes/ObjectMetadataItemScope.tsx
2023-10-31 12:38:53 +01:00

25 lines
665 B
TypeScript

import { ReactNode } from 'react';
import { ObjectMetadataItemScopeInternalContext } from './scope-internal-context/ObjectMetadataItemScopeInternalContext';
type ObjectMetadataItemScopeProps = {
children: ReactNode;
objectMetadataItemNamePlural: string;
};
export const ObjectMetadataItemScope = ({
children,
objectMetadataItemNamePlural,
}: ObjectMetadataItemScopeProps) => {
return (
<ObjectMetadataItemScopeInternalContext.Provider
value={{
scopeId: objectMetadataItemNamePlural,
objectNamePlural: objectMetadataItemNamePlural,
}}
>
{children}
</ObjectMetadataItemScopeInternalContext.Provider>
);
};