import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
import { Component, useField, SugaredField } from "@contember/binding";
import { FieldFallbackView } from "./FieldFallbackView.js";
const VideoFieldView = Component(
  ({
    srcField,
    titleField,
    formatUrl,
    fallback,
    fallbackStyle,
    ...videoProps
  }) => {
    const srcAccessor = useField(srcField);
    const titleAccessor = useField(titleField);
    if (srcAccessor.value === null) {
      return /* @__PURE__ */ jsxDEV(FieldFallbackView, { fallback, fallbackStyle }, void 0, false, {
        fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/fieldViews/VideoFieldView.tsx",
        lineNumber: 32,
        columnNumber: 11
      }, globalThis);
    }
    return (
      // The spread intentionally comes after alt and title so that it's possible to provide just static string values.
      /* @__PURE__ */ jsxDEV(
        "video",
        {
          src: formatUrl ? formatUrl(srcAccessor.value) : srcAccessor.value,
          title: titleAccessor?.value || void 0,
          controls: true,
          ...videoProps
        },
        void 0,
        false,
        {
          fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/fieldViews/VideoFieldView.tsx",
          lineNumber: 36,
          columnNumber: 4
        },
        globalThis
      )
    );
  },
  ({ srcField, titleField, fallback, fallbackStyle }) => /* @__PURE__ */ jsxDEV(Fragment, { children: [
    /* @__PURE__ */ jsxDEV(SugaredField, { field: srcField }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/fieldViews/VideoFieldView.tsx",
      lineNumber: 46,
      columnNumber: 4
    }, globalThis),
    titleField && /* @__PURE__ */ jsxDEV(SugaredField, { field: titleField }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/fieldViews/VideoFieldView.tsx",
      lineNumber: 47,
      columnNumber: 19
    }, globalThis),
    /* @__PURE__ */ jsxDEV(FieldFallbackView, { fallback, fallbackStyle }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/fieldViews/VideoFieldView.tsx",
      lineNumber: 48,
      columnNumber: 4
    }, globalThis)
  ] }, void 0, true, {
    fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/fieldViews/VideoFieldView.tsx",
    lineNumber: 45,
    columnNumber: 3
  }, globalThis),
  "VideoFieldView"
);
export {
  VideoFieldView
};
//# sourceMappingURL=VideoFieldView.js.map
