X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/ad2c0bec0c54962c028b5b2db7a1c6be3d9d12c8..f05e6a9cece7e3b118134136ee81bd7477ad10a0:/src/components/attribute/attribute.tsx diff --git a/src/components/attribute/attribute.tsx b/src/components/attribute/attribute.tsx index 131d629a..6d1c3bc3 100644 --- a/src/components/attribute/attribute.tsx +++ b/src/components/attribute/attribute.tsx @@ -9,26 +9,40 @@ import { ArvadosTheme } from 'src/common/custom-theme'; interface AttributeDataProps { label: string; + value?: string; + link?: string; } type AttributeProps = AttributeDataProps & WithStyles; class Attribute extends React.Component { + hasLink() { + return !!this.props.link; + } + render() { - const { label, children, classes } = this.props; + const { label, link, value, children, classes } = this.props; return - {label} - {children} - ; + {label} + { this.hasLink() ? ( + {value} + ) : ( + + {value} + {children} + + )} + ; } } -type CssRules = 'attribute' | 'label' | 'value'; +type CssRules = 'attribute' | 'label' | 'value' | 'link'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ attribute: { + height: '24px', display: 'flex', alignItems: 'center', marginBottom: theme.spacing.unit @@ -40,6 +54,10 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ value: { display: 'flex', alignItems: 'center' + }, + link: { + color: theme.palette.primary.main, + textDecoration: 'none' } });