'use strict'; import React from 'react'; let DetailProperty = React.createClass({ propTypes: { label: React.PropTypes.string, value: React.PropTypes.oneOfType([ React.PropTypes.string, React.PropTypes.element ]), separator: React.PropTypes.string, labelClassName: React.PropTypes.string, valueClassName: React.PropTypes.string }, getDefaultProps() { return { separator: ':', labelClassName: 'col-xs-5 col-sm-4 col-md-3 col-lg-3', valueClassName: 'col-xs-7 col-sm-8 col-md-9 col-lg-9' }; }, render() { let value = this.props.value; if (this.props.children){ value = (
{ this.props.value }
{ this.props.children }
); } return (
{ this.props.label + this.props.separator}
{value}
); } }); export default DetailProperty;