UNPKG

terriajs

Version:

Geospatial data visualization platform.

40 lines 2.18 kB
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { Trans, useTranslation } from "react-i18next"; import styled from "styled-components"; import { observer } from "mobx-react"; import { getName } from "../../../../../ModelMixins/CatalogMemberMixin"; import Box from "../../../../../Styled/Box"; import Ul, { Li } from "../../../../../Styled/List"; import Text from "../../../../../Styled/Text"; import { isShareable } from "../BuildShareLink"; import Spacing from "../../../../../Styled/Spacing"; const WarningBox = styled(Box).attrs({ paddedRatio: 2, rounded: true, column: true }) ` background: ${(props) => props.theme.infoColor}; color: ${(props) => props.theme.dark}; `; const WarningLink = styled.a ` color: ${(props) => props.theme.dark}; text-decoration: underline; cursor: pointer; `; export const ShareUrlWarning = observer(({ terria, viewState, callback }) => { const { t } = useTranslation(); const unshareableItems = terria.catalog.userAddedDataGroup.memberModels.filter((model) => !isShareable(terria)(model.uniqueId || "")); if (unshareableItems.length === 0) { return null; } const addWebData = () => { viewState.openUserData(); callback(); }; return (_jsxs(_Fragment, { children: [_jsx(Spacing, { bottom: 2 }), _jsxs(WarningBox, { children: [_jsxs(Trans, { t: t, i18nKey: "share.localDataNote", children: [_jsx(Text, { bold: true, children: _jsx("strong", { children: "Note:" }) }), _jsxs(Text, { children: ["The following data sources will NOT be shared because they include data from this local system or from an authenticated online service. To share these data sources, publish their data on a web server and", " ", _jsx(WarningLink, { onClick: addWebData, children: "add them using a url" }), "."] })] }), _jsx(Ul, { css: ` padding: 0; `, children: unshareableItems.map((item, i) => { return (_jsx(Li, { children: _jsx("strong", { children: getName(item) }) }, i)); }) })] }), _jsx(Spacing, { bottom: 2 })] })); }); //# sourceMappingURL=ShareUrlWarning.js.map