CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/frontend/account/editor-settings/autosave-interval.tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { useIntl } from "react-intl";
7
import { InputNumber } from "antd";
8
import { LabeledRow } from "@cocalc/frontend/components";
9
10
interface Props {
11
autosave: number;
12
on_change: (string, number) => void;
13
}
14
15
export function EditorSettingsAutosaveInterval(props: Props): JSX.Element {
16
const intl = useIntl();
17
18
return (
19
<LabeledRow
20
label={intl.formatMessage({
21
id: "account.editor-settings-autosave-interval.label",
22
defaultMessage: "Autosave interval",
23
})}
24
>
25
<InputNumber
26
onChange={(n) => props.on_change("autosave", n)}
27
min={15}
28
max={900}
29
value={props.autosave}
30
addonAfter="seconds"
31
/>
32
</LabeledRow>
33
);
34
}
35
36