Tom Butcher 0b501a11c6
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
Enhance ObjectList and ObjectProperty components with hyperlink support
- Updated ObjectList to accept a new prop, showHyperlink, allowing for conditional rendering of hyperlinks for object items.
- Modified ObjectProperty to pass the showHyperlink prop to ObjectList and ObjectSelect components, enhancing their functionality.
- Improved error handling in ApiServerContext by adding detailed logging for error responses.
- Updated various database models to include showHyperlink attribute for object lists, improving user navigation and interaction.
- Enhanced CSS styles for the permissions matrix table to improve visual clarity and user experience.
2026-08-20 17:26:36 +01:00

34 lines
785 B
JavaScript

import PropTypes from 'prop-types'
import ObjectDisplay from './ObjectDisplay'
import { Space, Typography } from 'antd'
const { Text } = Typography
const ObjectList = ({ value, objectType, style, showHyperlink = false }) => {
if (!value || !Array.isArray(value) || value.length === 0) {
return <Text type='secondary'>n/a</Text>
}
return (
<Space size={'small'} wrap style={style}>
{value.map((item) => (
<ObjectDisplay
object={item}
objectType={objectType}
key={item._id}
showHyperlink={showHyperlink}
/>
))}
</Space>
)
}
ObjectList.propTypes = {
value: PropTypes.array,
objectType: PropTypes.string,
style: PropTypes.object,
showHyperlink: PropTypes.bool
}
export default ObjectList