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-07-14 17:05:00 +03:00
|
|
|
import ToggleSwitch from '../utils/ToggleSwitch';
|
2020-08-24 18:32:20 +03:00
|
|
|
import { Settings } from './reducers/settings';
|
2020-04-25 10:49:54 +03:00
|
|
|
|
2020-08-24 18:32:20 +03:00
|
|
|
interface RealTimeUpdatesProps {
|
|
|
|
settings: Settings;
|
|
|
|
setRealTimeUpdates: (enabled: boolean) => void;
|
|
|
|
}
|
2020-04-25 10:49:54 +03:00
|
|
|
|
2020-08-24 18:32:20 +03:00
|
|
|
const RealTimeUpdates = ({ settings: { realTimeUpdates }, setRealTimeUpdates }: RealTimeUpdatesProps) => (
|
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>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default RealTimeUpdates;
|