gecko-dev/devtools/client/aboutdebugging/components/target-list.js
Julian Descottes b84da33d51 Bug 1250002 - part2: about:debugging switch to browserLoader;r=ochameau
MozReview-Commit-ID: G4O19TOTWOy

--HG--
extra : rebase_source : 444aa09b859bd2ef04856dc0db4ca52bc05e7906
2016-02-23 02:00:51 +01:00

38 lines
1.1 KiB
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* global React */
"use strict";
const Services = require("Services");
const React = require("devtools/client/shared/vendor/react");
const { Target } = require("./target");
const Strings = Services.strings.createBundle(
"chrome://devtools/locale/aboutdebugging.properties");
const LocaleCompare = (a, b) => {
return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
};
exports.TargetList = React.createClass({
displayName: "TargetList",
render() {
let { client, debugDisabled } = this.props;
let targets = this.props.targets.sort(LocaleCompare).map(target => {
return React.createElement(Target, { client, target, debugDisabled });
});
return (
React.createElement("div", { id: this.props.id, className: "targets" },
React.createElement("h4", null, this.props.name),
targets.length > 0 ? targets :
React.createElement("p", null, Strings.GetStringFromName("nothing"))
)
);
},
});