4087 refactor object metadata item hooks and utils (#4861)
- Extracted each exported element from useObjectMetadataItem into its own hook.
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
import * as React from 'react';
|
||||
|
||||
import { useMapToObjectRecordIdentifier } from '@/object-metadata/hooks/useMapToObjectRecordIdentifier';
|
||||
import { useObjectMetadataItemOnly } from '@/object-metadata/hooks/useObjectMetadataItemOnly';
|
||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { EntityChip } from '@/ui/display/chip/components/EntityChip';
|
||||
|
||||
@ -18,14 +17,10 @@ export const RecordChip = ({
|
||||
maxWidth,
|
||||
className,
|
||||
}: RecordChipProps) => {
|
||||
const { objectMetadataItem } = useObjectMetadataItemOnly({
|
||||
const { mapToObjectRecordIdentifier } = useMapToObjectRecordIdentifier({
|
||||
objectNameSingular,
|
||||
});
|
||||
|
||||
const mapToObjectRecordIdentifier = useMapToObjectRecordIdentifier({
|
||||
objectMetadataItem,
|
||||
});
|
||||
|
||||
const objectRecordIdentifier = mapToObjectRecordIdentifier(record);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user