UNPKG

admin-on-rest-fr05t1k

Version:

A frontend Framework for building admin applications on top of REST services, using ES6, React and Material UI

24 lines (18 loc) 546 B
import React, { PropTypes } from 'react'; import get from 'lodash.get'; import pure from 'recompose/pure'; const TextField = ({ source, record = {}, elStyle }) => { return <span style={elStyle}>{get(record, source)}</span>; } TextField.propTypes = { addLabel: PropTypes.bool, elStyle: PropTypes.object, label: PropTypes.string, record: PropTypes.object, source: PropTypes.string.isRequired, }; const PureTextField = pure(TextField); PureTextField.defaultProps = { addLabel: true, }; export default PureTextField;