From 6da485bc8f885b00fd7207a0bd17e82f082e5274 Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Sun, 7 Dec 2025 02:41:45 +0000 Subject: [PATCH] Enhance IdDisplay component with reference and plainCode props - Added reference prop to allow custom display of IDs. - Introduced plainCode prop to toggle between code and text display styles. - Updated rendering logic to accommodate new props for improved flexibility in ID presentation. --- src/components/Dashboard/common/IdDisplay.jsx | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/components/Dashboard/common/IdDisplay.jsx b/src/components/Dashboard/common/IdDisplay.jsx index ed19950..1329c36 100644 --- a/src/components/Dashboard/common/IdDisplay.jsx +++ b/src/components/Dashboard/common/IdDisplay.jsx @@ -11,6 +11,8 @@ const { Text, Link } = Typography const IdDisplay = ({ id, + reference = null, + plainCode = false, type, showCopy = true, longId = true, @@ -44,23 +46,37 @@ const IdDisplay = ({ displayId = prefix + ':' + id.toString().slice(-6) } + if (reference) { + displayId = prefix + ':' + reference + } + return ( {(() => { - const textElement = ( - {displayId} - + ) + if (plainCode == false) { + textElement = ( + + {displayId} + + ) + } + // If hyperlink is enabled if (showHyperlink && hyperlink != null) { const linkElement = ( @@ -128,9 +144,11 @@ const IdDisplay = ({ IdDisplay.propTypes = { id: PropTypes.string, type: PropTypes.string, + reference: PropTypes.string, showCopy: PropTypes.bool, longId: PropTypes.bool, showHyperlink: PropTypes.bool, + plainCode: PropTypes.bool, showSpotlight: PropTypes.bool }