import { jsxDEV } from "react/jsx-dev-runtime";
import { Component, useField, SugaredField } from "@contember/binding";
const FileUrlFieldView = Component(
  ({ fileUrlField, ...props }) => {
    const fieldAccessor = useField(fileUrlField);
    const url = fieldAccessor.value;
    return /* @__PURE__ */ jsxDEV(
      "a",
      {
        style: { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", direction: "rtl" },
        href: url,
        target: "_blank",
        rel: "noopener noreferrer",
        ...props,
        children: url.substring(Math.max(0, url.lastIndexOf("/") + 1))
      },
      void 0,
      false,
      {
        fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/fieldViews/FileUrlFieldView.tsx",
        lineNumber: 19,
        columnNumber: 4
      },
      globalThis
    );
  },
  (props) => /* @__PURE__ */ jsxDEV(SugaredField, { field: props.fileUrlField }, void 0, false, {
    fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/fieldViews/FileUrlFieldView.tsx",
    lineNumber: 30,
    columnNumber: 11
  }, globalThis),
  "FileUrlFieldView"
);
export {
  FileUrlFieldView
};
//# sourceMappingURL=FileUrlFieldView.js.map
