about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/report/components/status_check_box.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript/mastodon/features/report/components/status_check_box.js')
-rw-r--r--app/javascript/mastodon/features/report/components/status_check_box.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/app/javascript/mastodon/features/report/components/status_check_box.js b/app/javascript/mastodon/features/report/components/status_check_box.js
new file mode 100644
index 000000000..85f792479
--- /dev/null
+++ b/app/javascript/mastodon/features/report/components/status_check_box.js
@@ -0,0 +1,40 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import ImmutablePropTypes from 'react-immutable-proptypes';
+import emojify from '../../../emoji';
+import Toggle from 'react-toggle';
+
+class StatusCheckBox extends React.PureComponent {
+
+  render () {
+    const { status, checked, onToggle, disabled } = this.props;
+    const content = { __html: emojify(status.get('content')) };
+
+    if (status.get('reblog')) {
+      return null;
+    }
+
+    return (
+      <div className='status-check-box'>
+        <div
+          className='status__content'
+          dangerouslySetInnerHTML={content}
+        />
+
+        <div className='status-check-box-toggle'>
+          <Toggle checked={checked} onChange={onToggle} disabled={disabled} />
+        </div>
+      </div>
+    );
+  }
+
+}
+
+StatusCheckBox.propTypes = {
+  status: ImmutablePropTypes.map.isRequired,
+  checked: PropTypes.bool,
+  onToggle: PropTypes.func.isRequired,
+  disabled: PropTypes.bool
+};
+
+export default StatusCheckBox;