ColumnLastEventId.js (1056B)
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 { 8 Component, 9 } = require("resource://devtools/client/shared/vendor/react.mjs"); 10 const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); 11 const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.mjs"); 12 13 /** 14 * Renders the "LastEventId" column of a message. 15 */ 16 class ColumnLastEventId extends Component { 17 static get propTypes() { 18 return { 19 item: PropTypes.object.isRequired, 20 }; 21 } 22 23 shouldComponentUpdate(nextProps) { 24 return this.props.item.lastEventId !== nextProps.item.lastEventId; 25 } 26 27 render() { 28 const { lastEventId } = this.props.item; 29 30 return dom.td( 31 { 32 className: "message-list-column message-list-lastEventId", 33 title: lastEventId, 34 }, 35 lastEventId 36 ); 37 } 38 } 39 40 module.exports = ColumnLastEventId;