import { createElement, Fragment } from "react";
import { Component } from "@contember/binding";
import { fieldViewDictionary } from "./fieldViewDictionary.js";
import { useMessageFormatter } from "../../../i18n/useMessageFormatter.js";
const FieldFallbackView = Component((props) => {
  const formatMessage = useMessageFormatter(fieldViewDictionary);
  if (props.fallback !== void 0) {
    return /* @__PURE__ */ createElement(Fragment, null, props.fallback);
  }
  switch (props.fallbackStyle) {
    case "nothing":
      return null;
    case "unknown":
      return /* @__PURE__ */ createElement("i", {
        style: { opacity: 0.4, fontSize: "0.75em" }
      }, formatMessage("fieldView.fallback.unknown"));
    case "n/a":
    default:
      return /* @__PURE__ */ createElement("i", {
        style: { opacity: 0.4, fontSize: "0.75em" }
      }, formatMessage("fieldView.fallback.notAvailable"));
  }
}, (props) => /* @__PURE__ */ createElement(Fragment, null, props.fallback), "FieldFallbackView");
export { FieldFallbackView };
//# sourceMappingURL=FieldFallbackView.js.map
