diff options
Diffstat (limited to 'devtools/client/webconsole/components/FilterBar/FilterCheckbox.js')
-rw-r--r-- | devtools/client/webconsole/components/FilterBar/FilterCheckbox.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/devtools/client/webconsole/components/FilterBar/FilterCheckbox.js b/devtools/client/webconsole/components/FilterBar/FilterCheckbox.js new file mode 100644 index 0000000000..f36788e998 --- /dev/null +++ b/devtools/client/webconsole/components/FilterBar/FilterCheckbox.js @@ -0,0 +1,31 @@ +/* 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 PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); + +FilterCheckbox.displayName = "FilterCheckbox"; + +FilterCheckbox.propTypes = { + label: PropTypes.string.isRequired, + title: PropTypes.string, + checked: PropTypes.bool.isRequired, + onChange: PropTypes.func.isRequired, +}; + +function FilterCheckbox(props) { + const { checked, label, title, onChange } = props; + return dom.label( + { title, className: "filter-checkbox" }, + dom.input({ + type: "checkbox", + checked, + onChange, + }), + label + ); +} + +module.exports = FilterCheckbox; |