import React, { Component, PropTypes } from 'react'; import styles from './profile.scss'; export default class ProfileField extends Component { static displayName = 'ProfileField'; static propTypes = { label: React.PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired, value: React.PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired, warningMessage: React.PropTypes.oneOfType([PropTypes.string, PropTypes.element]), readonly: PropTypes.bool }; render() { const {label, value, warningMessage, readonly} = this.props; return (
{label}:
{value}
{readonly ? '' : (
)}
{warningMessage ? (
{warningMessage}
) : ''}
); } }