Completed
Push — master ( aa59a9...9ba8bc )
by Alejandro
27s queued 10s
created

src/settings/RealTimeUpdates.js

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 32
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 0
eloc 29
mnd 0
bc 0
fnc 0
dl 0
loc 32
ccs 0
cts 4
cp 0
bpm 0
cpm 0
noi 0
c 0
b 0
f 0
1
import React from 'react';
2
import { Card, CardBody, CardHeader, UncontrolledTooltip } from 'reactstrap';
3
import PropTypes from 'prop-types';
4
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
5
import { faInfoCircle } from '@fortawesome/free-solid-svg-icons';
6
import Checkbox from '../utils/Checkbox';
7
import { RealTimeUpdatesType } from './reducers/realTimeUpdates';
8
9
const propTypes = {
10
  realTimeUpdates: RealTimeUpdatesType,
11
  setRealTimeUpdates: PropTypes.func,
12
};
13
14
const RealTimeUpdates = ({ realTimeUpdates, setRealTimeUpdates }) => (
15
  <Card>
16
    <CardHeader>Real-time updates</CardHeader>
17
    <CardBody>
18
      <Checkbox checked={realTimeUpdates.enabled} onChange={setRealTimeUpdates}>
19
        Enable real-time updates
20
        <FontAwesomeIcon icon={faInfoCircle} className="ml-2" id="realTimeUpdatesInfo" />
21
      </Checkbox>
22
      <UncontrolledTooltip target="realTimeUpdatesInfo">
23
        Enable or disable real-time updates, when using Shlink v2.2.0 or newer.
24
      </UncontrolledTooltip>
25
    </CardBody>
26
  </Card>
27
);
28
29
RealTimeUpdates.propTypes = propTypes;
30
31
export default RealTimeUpdates;
32