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/keyboard-bindings.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
8
import { LabeledRow, SelectorInput } from "@cocalc/frontend/components";
9
import { EDITOR_BINDINGS } from "@cocalc/util/db-schema/accounts";
10
11
interface Props {
12
bindings: string;
13
on_change: (selected: string) => void;
14
}
15
16
export function EditorSettingsKeyboardBindings(props: Props): JSX.Element {
17
const intl = useIntl();
18
19
const label = intl.formatMessage({
20
id: "account.editor-settings.keyboard-bindings.label",
21
defaultMessage: "Editor keyboard bindings",
22
});
23
24
return (
25
<LabeledRow label={label}>
26
<SelectorInput
27
options={EDITOR_BINDINGS}
28
selected={props.bindings}
29
on_change={props.on_change}
30
/>
31
</LabeledRow>
32
);
33
}
34
35