import { Component } from "@contember/binding";
import { fieldViewDictionary } from "./fieldViewDictionary.js";
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
import { useMessageFormatter } from "../../../i18n/useMessageFormatter.js";
var _jsxFileName = "/__w/interface/interface/packages/admin/src/components/bindingFacade/fieldViews/FieldFallbackView.tsx";
const FieldFallbackView = Component((props) => {
  const formatMessage = useMessageFormatter(fieldViewDictionary);
  if (props.fallback !== void 0) {
    return /* @__PURE__ */ jsxDEV(Fragment, {
      children: props.fallback
    }, void 0, false);
  }
  switch (props.fallbackStyle) {
    case "nothing":
      return null;
    case "unknown":
      return /* @__PURE__ */ jsxDEV("i", {
        style: {
          opacity: 0.4,
          fontSize: "0.75em"
        },
        children: formatMessage("fieldView.fallback.unknown")
      }, void 0, false, {
        fileName: _jsxFileName,
        lineNumber: 26,
        columnNumber: 12
      }, void 0);
    case "n/a":
    default:
      return /* @__PURE__ */ jsxDEV("i", {
        style: {
          opacity: 0.4,
          fontSize: "0.75em"
        },
        children: formatMessage("fieldView.fallback.notAvailable")
      }, void 0, false, {
        fileName: _jsxFileName,
        lineNumber: 29,
        columnNumber: 12
      }, void 0);
  }
}, (props) => /* @__PURE__ */ jsxDEV(Fragment, {
  children: props.fallback
}, void 0, false), "FieldFallbackView");
export {
  FieldFallbackView
};
//# sourceMappingURL=FieldFallbackView.js.map
