Enhance SpotlightTooltip component with model property integration
- Added the getModelProperty function to SpotlightTooltip for improved property handling. - Updated ObjectProperty component to utilize dynamic properties based on the model type, enhancing flexibility in data representation.
This commit is contained in:
parent
8319d3d7b3
commit
084d807c95
@ -8,7 +8,10 @@ import ObjectProperty from './ObjectProperty'
|
|||||||
import InfoCircleIcon from '../../Icons/InfoCircleIcon'
|
import InfoCircleIcon from '../../Icons/InfoCircleIcon'
|
||||||
import { ApiServerContext } from '../context/ApiServerContext'
|
import { ApiServerContext } from '../context/ApiServerContext'
|
||||||
import merge from 'lodash/merge'
|
import merge from 'lodash/merge'
|
||||||
import { getModelByName } from '../../../database/ObjectModels'
|
import {
|
||||||
|
getModelByName,
|
||||||
|
getModelProperty
|
||||||
|
} from '../../../database/ObjectModels'
|
||||||
|
|
||||||
const { Text } = Typography
|
const { Text } = Typography
|
||||||
|
|
||||||
@ -128,7 +131,7 @@ const SpotlightTooltip = ({ query, type }) => {
|
|||||||
return (
|
return (
|
||||||
<Descriptions.Item key={prop.name} label={prop.label}>
|
<Descriptions.Item key={prop.name} label={prop.label}>
|
||||||
<ObjectProperty
|
<ObjectProperty
|
||||||
type={prop.type}
|
{...getModelProperty(type, prop.name)}
|
||||||
value={value}
|
value={value}
|
||||||
objectData={spotlightData}
|
objectData={spotlightData}
|
||||||
objectType={prop.objectType || type}
|
objectType={prop.objectType || type}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user