Integrate IdDisplay component into ObjectDisplay for improved ID handling; conditionally render ID when object name is absent.
This commit is contained in:
parent
5cf4976635
commit
b6cd1bac0b
@ -5,6 +5,7 @@ import { getModelByName } from '../../../database/ObjectModels'
|
|||||||
import { ApiServerContext } from '../context/ApiServerContext'
|
import { ApiServerContext } from '../context/ApiServerContext'
|
||||||
import { AuthContext } from '../context/AuthContext'
|
import { AuthContext } from '../context/AuthContext'
|
||||||
import merge from 'lodash/merge'
|
import merge from 'lodash/merge'
|
||||||
|
import IdDisplay from './IdDisplay'
|
||||||
|
|
||||||
const { Text } = Typography
|
const { Text } = Typography
|
||||||
|
|
||||||
@ -55,7 +56,15 @@ const ObjectDisplay = ({ object, objectType }) => {
|
|||||||
<Flex gap={'small'} align='center'>
|
<Flex gap={'small'} align='center'>
|
||||||
<Icon />
|
<Icon />
|
||||||
{objectData?.color ? <Badge color={objectData?.color} /> : null}
|
{objectData?.color ? <Badge color={objectData?.color} /> : null}
|
||||||
<Text ellipsis>{objectData?.name ? objectData.name : null}</Text>
|
{objectData?.name ? <Text ellipsis>{objectData.name}</Text> : null}
|
||||||
|
{objectData?._id && !objectData?.name ? (
|
||||||
|
<IdDisplay
|
||||||
|
id={objectData?._id}
|
||||||
|
type={objectType}
|
||||||
|
longId={false}
|
||||||
|
showCopy={false}
|
||||||
|
/>
|
||||||
|
) : null}
|
||||||
</Flex>
|
</Flex>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user