Total Complexity | 0 |
Complexity/F | 0 |
Lines of Code | 32 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Coverage | 0% |
Changes | 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 |