import { Component, useField, SugaredField } from "@contember/binding";
import { jsxDEV } from "react/jsx-dev-runtime";
var _jsxFileName = "/__w/interface/interface/packages/admin/src/components/bindingFacade/fieldViews/FileUrlFieldView.tsx";
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: _jsxFileName,
    lineNumber: 13,
    columnNumber: 4
  }, void 0);
}, (props) => /* @__PURE__ */ jsxDEV(SugaredField, {
  field: props.fileUrlField
}, void 0, false, {
  fileName: _jsxFileName,
  lineNumber: 24,
  columnNumber: 11
}, void 0), "FileUrlFieldView");
export {
  FileUrlFieldView
};
//# sourceMappingURL=FileUrlFieldView.js.map
