UNPKG

863 BJavaScriptView Raw
1/*
2 * Copyright (c) Jupyter Development Team.
3 * Distributed under the terms of the Modified BSD License.
4 */
5import { ReactWidget } from '@jupyterlab/apputils';
6import { nullTranslator } from '@jupyterlab/translation';
7import * as React from 'react';
8/**
9 * create readonly label toolbar item
10 */
11export function createReadonlyLabel(panel, translator) {
12 var _a;
13 let trans = (translator !== null && translator !== void 0 ? translator : nullTranslator).load('jupyterlab');
14 return ReactWidget.create(React.createElement("div", null,
15 React.createElement("span", { className: "jp-ToolbarLabelComponent", title: trans.__(`Document is read-only. "Save" is disabled; use "Save as…" instead`) }, trans.__(`%1 is read-only`, (_a = panel.context.contentsModel) === null || _a === void 0 ? void 0 : _a.type))));
16}
17//# sourceMappingURL=components.js.map
\No newline at end of file