import React from 'react'
import PropTypes from 'prop-types'
import { List, Typography, Flex } from 'antd'
import { getModelByName } from '../../../database/ObjectModels'
import IdDisplay from './IdDisplay'
const { Text } = Typography
const ObjectList = ({ value, objectType, bordered = true }) => {
if (!value || !Array.isArray(value) || value.length === 0) {
return n/a
}
return (
{
const model = getModelByName(objectType)
const Icon = model.icon
return (
{item?.name ? {item.name} : null}
{item?._id ? (
) : null}
)
}}
style={{ width: '100%' }}
/>
)
}
ObjectList.propTypes = {
value: PropTypes.array,
bordered: PropTypes.bool,
objectType: PropTypes.string
}
export default ObjectList