Tom Butcher 90d9ed286d Enhance Dashboard Components with New Features and Styling Improvements
- Updated App.css to refine styling for object display tags and introduced a border for better visual distinction.
- Enhanced NewDocumentJob component by adding a default quantity value for improved user experience.
- Introduced PrinterQueue component to manage and display printer job queues, enhancing the ControlPrinter functionality.
- Improved MissingPlaceholder component with additional props for customizable border and padding options.
- Adjusted ObjectDisplay and ObjectList components for better layout and interaction, including cursor changes for clickable elements.
- Updated ThemeContext to manage new color variables for consistent theming across components.
2026-08-22 20:02:50 +01:00

61 lines
1.2 KiB
JavaScript

import PropTypes from 'prop-types'
import ObjectDisplay from './ObjectDisplay'
import { Flex, Typography } from 'antd'
import ScrollBox from './ScrollBox'
const { Text } = Typography
const ObjectList = ({
value,
objectType,
style,
showHyperlink = false,
scrollHorizontal = false
}) => {
if (!value || !Array.isArray(value) || value.length === 0) {
return <Text type='secondary'>n/a</Text>
}
const listContents = (
<Flex
gap={'4px'}
wrap={!scrollHorizontal}
style={{
...style,
width: 'fit-content'
}}
justify={'start'}
>
{value.map((item) => (
<div key={item._id} style={{ flexShrink: 0 }}>
<ObjectDisplay
object={item}
objectType={objectType}
showHyperlink={showHyperlink}
/>
</div>
))}
</Flex>
)
if (scrollHorizontal) {
return (
<ScrollBox horizontalBottomPadding={9}>
{listContents}
</ScrollBox>
)
} else {
return listContents
}
}
ObjectList.propTypes = {
value: PropTypes.array,
objectType: PropTypes.string,
style: PropTypes.object,
showHyperlink: PropTypes.bool,
scrollHorizontal: PropTypes.bool
}
export default ObjectList