UNPKG

@grafana/ui

Version:
29 lines (24 loc) 1.69 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var jsxRuntime = require('react/jsx-runtime'); var i18n = require('@grafana/i18n'); var Icon = require('../Icon/Icon.cjs'); var Box = require('../Layout/Box/Box.cjs'); var Stack = require('../Layout/Stack/Stack.cjs'); var Text = require('../Text/Text.cjs'); "use strict"; const AsyncError = () => /* @__PURE__ */ jsxRuntime.jsxs(MessageRow, { children: [ /* @__PURE__ */ jsxRuntime.jsx(Text.Text, { color: "warning", children: /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { name: "exclamation-triangle", size: "md" }) }), /* @__PURE__ */ jsxRuntime.jsx(i18n.Trans, { i18nKey: "combobox.async.error", children: "An error occurred while loading options." }) ] }); const NO_OPTIONS_I18N_KEY = "combobox.options.no-found"; const NotFoundError = ({ message }) => /* @__PURE__ */ jsxRuntime.jsx(MessageRow, { children: message != null ? message : /* @__PURE__ */ jsxRuntime.jsx(i18n.Trans, { i18nKey: NO_OPTIONS_I18N_KEY, children: "No options found." }) }); const LoadingOptions = () => /* @__PURE__ */ jsxRuntime.jsx(MessageRow, { children: /* @__PURE__ */ jsxRuntime.jsx(i18n.Trans, { i18nKey: "combobox.options.loading", children: "Loading options..." }) }); const MessageRow = ({ children }) => { return /* @__PURE__ */ jsxRuntime.jsx(Box.Box, { padding: 2, children: /* @__PURE__ */ jsxRuntime.jsx(Stack.Stack, { justifyContent: "center", alignItems: "center", direction: "column", children }) }); }; exports.AsyncError = AsyncError; exports.LoadingOptions = LoadingOptions; exports.NO_OPTIONS_I18N_KEY = NO_OPTIONS_I18N_KEY; exports.NotFoundError = NotFoundError; //# sourceMappingURL=MessageRows.cjs.map