2020-04-25 10:49:54 +03:00
|
|
|
import React from 'react';
|
2020-05-03 21:16:21 +03:00
|
|
|
import { Card, CardBody, CardHeader } from 'reactstrap';
|
2020-04-25 10:49:54 +03:00
|
|
|
import PropTypes from 'prop-types';
|
2020-07-14 17:05:00 +03:00
|
|
|
import ToggleSwitch from '../utils/ToggleSwitch';
|
2020-04-26 14:00:23 +03:00
|
|
|
import { SettingsType } from './reducers/settings';
|
2020-04-25 10:49:54 +03:00
|
|
|
|
|
|
|
const propTypes = {
|
2020-04-26 14:00:23 +03:00
|
|
|
settings: SettingsType,
|
2020-04-25 10:49:54 +03:00
|
|
|
setRealTimeUpdates: PropTypes.func,
|
|
|
|
};
|
|
|
|
|
2020-04-26 14:00:23 +03:00
|
|
|
const RealTimeUpdates = ({ settings: { realTimeUpdates }, setRealTimeUpdates }) => (
|
2020-04-25 10:49:54 +03:00
|
|
|
<Card>
|
|
|
|
<CardHeader>Real-time updates</CardHeader>
|
|
|
|
<CardBody>
|
2020-07-14 17:05:00 +03:00
|
|
|
<ToggleSwitch checked={realTimeUpdates.enabled} onChange={setRealTimeUpdates}>
|
2020-04-25 10:49:54 +03:00
|
|
|
Enable or disable real-time updates, when using Shlink v2.2.0 or newer.
|
2020-07-14 17:05:00 +03:00
|
|
|
</ToggleSwitch>
|
2020-04-25 10:49:54 +03:00
|
|
|
</CardBody>
|
|
|
|
</Card>
|
|
|
|
);
|
|
|
|
|
|
|
|
RealTimeUpdates.propTypes = propTypes;
|
|
|
|
|
|
|
|
export default RealTimeUpdates;
|