UNPKG

@roderickhsiao/react-i13n

Version:

[Experiment] React I13n provides a performant and scalable solution to application instrumentation.

40 lines (38 loc) 1.11 kB
/** * Copyright 2015 - Present, Yahoo Inc. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ import React from 'react'; import PropTypes from 'prop-types'; import DashboardTitle from './DashboardTitle'; import DashboardItem from './DashboardItem'; var DashboardContainer = props => { var { title, model, DOMNode } = props; var style = { margin: '0px', paddingLeft: '0px', boxShadow: '0 1px 4px 0 rgba(0,0,0,.28)', listStyle: 'none' }; return /*#__PURE__*/React.createElement("ul", { style: style }, /*#__PURE__*/React.createElement(DashboardTitle, { title: title }), Object.keys(model).map(key => { var modelItem = model[key]; var text = "".concat(key, " : ").concat(modelItem.value).concat(modelItem.DOMNode !== DOMNode ? ' (inherited)' : ''); return /*#__PURE__*/React.createElement(DashboardItem, { key: text, text: text }); })); }; DashboardContainer.propTypes = { title: PropTypes.string.isRequired, model: PropTypes.shape().isRequired }; export default DashboardContainer;