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 { AuthContext } from '../context/AuthContext'
|
||||
import merge from 'lodash/merge'
|
||||
import IdDisplay from './IdDisplay'
|
||||
|
||||
const { Text } = Typography
|
||||
|
||||
@ -55,7 +56,15 @@ const ObjectDisplay = ({ object, objectType }) => {
|
||||
<Flex gap={'small'} align='center'>
|
||||
<Icon />
|
||||
{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>
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user