shlink-web-client/src/settings/RealTimeUpdates.tsx

23 lines
718 B
TypeScript
Raw Normal View History

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-08-24 18:32:20 +03:00
interface RealTimeUpdatesProps {
settings: Settings;
setRealTimeUpdates: (enabled: boolean) => void;
}
2020-08-24 18:32:20 +03:00
const RealTimeUpdates = ({ settings: { realTimeUpdates }, setRealTimeUpdates }: RealTimeUpdatesProps) => (
<Card>
<CardHeader>Real-time updates</CardHeader>
<CardBody>
2020-07-14 17:05:00 +03:00
<ToggleSwitch checked={realTimeUpdates.enabled} onChange={setRealTimeUpdates}>
Enable or disable real-time updates, when using Shlink v2.2.0 or newer.
2020-07-14 17:05:00 +03:00
</ToggleSwitch>
</CardBody>
</Card>
);
export default RealTimeUpdates;