ManifestItem.js (1203B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 "use strict"; 6 7 const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.mjs"); 8 const { 9 PureComponent, 10 } = require("resource://devtools/client/shared/vendor/react.mjs"); 11 const { 12 tr, 13 td, 14 th, 15 } = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); 16 17 /** 18 * This component displays a key-value data pair from a manifest 19 */ 20 class ManifestItem extends PureComponent { 21 static get propTypes() { 22 return { 23 label: PropTypes.node.isRequired, 24 children: PropTypes.node, 25 }; 26 } 27 28 render() { 29 const { children, label } = this.props; 30 return tr( 31 { 32 className: "manifest-item js-manifest-item", 33 }, 34 th( 35 { 36 className: "manifest-item__label js-manifest-item-label", 37 scope: "row", 38 }, 39 label 40 ), 41 td( 42 { className: "manifest-item__value js-manifest-item-content" }, 43 children 44 ) 45 ); 46 } 47 } 48 49 // Exports 50 module.exports = ManifestItem;