@grafana/ui
Version:
Grafana Components Library
22 lines (19 loc) • 1.38 kB
JavaScript
import { jsxs, jsx } from 'react/jsx-runtime';
import { Trans } from '@grafana/i18n';
import { Icon } from '../Icon/Icon.mjs';
import { Box } from '../Layout/Box/Box.mjs';
import { Stack } from '../Layout/Stack/Stack.mjs';
import { Text } from '../Text/Text.mjs';
;
const AsyncError = () => /* @__PURE__ */ jsxs(MessageRow, { children: [
/* @__PURE__ */ jsx(Text, { color: "warning", children: /* @__PURE__ */ jsx(Icon, { name: "exclamation-triangle", size: "md" }) }),
/* @__PURE__ */ jsx(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__ */ jsx(MessageRow, { children: message != null ? message : /* @__PURE__ */ jsx(Trans, { i18nKey: NO_OPTIONS_I18N_KEY, children: "No options found." }) });
const LoadingOptions = () => /* @__PURE__ */ jsx(MessageRow, { children: /* @__PURE__ */ jsx(Trans, { i18nKey: "combobox.options.loading", children: "Loading options..." }) });
const MessageRow = ({ children }) => {
return /* @__PURE__ */ jsx(Box, { padding: 2, children: /* @__PURE__ */ jsx(Stack, { justifyContent: "center", alignItems: "center", direction: "column", children }) });
};
export { AsyncError, LoadingOptions, NO_OPTIONS_I18N_KEY, NotFoundError };
//# sourceMappingURL=MessageRows.mjs.map