mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 02:05:42 +00:00
b28f45e73c
--HG-- rename : devtools/client/aboutdebugging/components/target.js => devtools/client/aboutdebugging/components/worker-target.js extra : histedit_source : 491a2f2466fca9d0a2a208264cee679ff1b57577
35 lines
1.0 KiB
JavaScript
35 lines
1.0 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/. */
|
|
|
|
"use strict";
|
|
|
|
const { createClass, DOM: dom } =
|
|
require("devtools/client/shared/vendor/react");
|
|
const Services = require("Services");
|
|
|
|
const Strings = Services.strings.createBundle(
|
|
"chrome://devtools/locale/aboutdebugging.properties");
|
|
|
|
const LocaleCompare = (a, b) => {
|
|
return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
|
|
};
|
|
|
|
module.exports = createClass({
|
|
displayName: "TargetList",
|
|
|
|
render() {
|
|
let { client, debugDisabled, targetClass } = this.props;
|
|
let targets = this.props.targets.sort(LocaleCompare).map(target => {
|
|
return targetClass({ client, target, debugDisabled });
|
|
});
|
|
|
|
return dom.div({ id: this.props.id, className: "targets" },
|
|
dom.h4(null, this.props.name),
|
|
targets.length > 0 ?
|
|
targets :
|
|
dom.p(null, Strings.GetStringFromName("nothing"))
|
|
);
|
|
},
|
|
});
|