Skip to content

Commit 0247091

Browse files
author
Sharma
committed
Fixed a Semantic Link field not getting rendered in Details
1 parent 726b650 commit 0247091

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

packages/react-sdk-components/src/components/field/SemanticLink/SemanticLink.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Link } from '@mui/material';
1+
import { FormControl, FormLabel, Link } from '@mui/material';
22
import makeStyles from '@mui/styles/makeStyles';
33

44
import type { PConnFieldProps } from '../../../types/PConnProps';
@@ -53,6 +53,7 @@ interface SemanticLinkProps extends PConnFieldProps {
5353
export default function SemanticLink(props: SemanticLinkProps) {
5454
const {
5555
text,
56+
label,
5657
resourcePayload = {},
5758
resourceParams = {},
5859
getPConnect,
@@ -201,8 +202,15 @@ export default function SemanticLink(props: SemanticLinkProps) {
201202
}
202203

203204
return (
204-
<Link component='button' {...linkComponentProps} {...restProps} onClick={openLinkClick} data-testid={testId}>
205-
{text}
206-
</Link>
205+
<FormControl variant='standard' sx={{ display: 'flex', flexDirection: 'row' }}>
206+
<FormLabel sx={{ marginRight: '2rem' }}>{label}</FormLabel>
207+
{text ? (
208+
<Link component='button' {...linkComponentProps} {...restProps} onClick={openLinkClick} data-testid={testId}>
209+
{text}
210+
</Link>
211+
) : (
212+
'---'
213+
)}
214+
</FormControl>
207215
);
208216
}

0 commit comments

Comments
 (0)