"ui-admin/src/js/components/database/DatabaseTab.jsx" did not exist on "dcf13450227a4635fb827f757bb08cc4eab7398f"
Newer
Older
import _ from 'lodash'
piotr.kupczyk@id.ethz.ch
committed
import React from 'react'
import { withStyles } from '@material-ui/core/styles'
import Typography from '@material-ui/core/Typography'
import InfoIcon from '@material-ui/icons/Info'
import Tooltip from '@src/js/components/common/form/Tooltip.jsx'
piotr.kupczyk@id.ethz.ch
committed
const styles = theme => ({
container: {
display: 'flex',
flexDirection: 'row',
alignItems: 'center'
},
control: {
flex: '1 1 auto'
},
piotr.kupczyk@id.ethz.ch
committed
label: {
fontSize: theme.typography.label.fontSize,
color: theme.typography.label.color
},
value: {
paddingBottom: theme.spacing(1) / 2,
borderBottomWidth: '1px',
piotr.kupczyk@id.ethz.ch
committed
borderBottomStyle: 'solid',
piotr.kupczyk@id.ethz.ch
committed
borderBottomColor: theme.palette.border.secondary
piotr.kupczyk@id.ethz.ch
committed
},
description: {
flex: '0 0 auto',
'& svg': {
color: theme.palette.hint.main
},
cursor: 'pointer'
}
piotr.kupczyk@id.ethz.ch
committed
})
class FormFieldView extends React.PureComponent {
render() {
const { label, value, description, classes } = this.props
piotr.kupczyk@id.ethz.ch
committed
return (
piotr.kupczyk@id.ethz.ch
committed
<div className={classes.container}>
<div className={classes.control}>
<Typography variant='body2' component='div' className={classes.label}>
{label}
</Typography>
<Typography variant='body2' component='div' className={classes.value}>
{value ? value : <span> </span>}
</Typography>
</div>
{!_.isNil(description) && (
<div className={classes.description}>
<Tooltip title={description}>
<InfoIcon fontSize='small' />
</Tooltip>
</div>
)}
piotr.kupczyk@id.ethz.ch
committed
</div>
)
}
}
export default withStyles(styles)(FormFieldView)