import { jsxDEV } from "react/jsx-dev-runtime";
import { AnchorButton, Stack, VisuallyHidden } from "@contember/ui";
import { ArrowLeftIcon } from "lucide-react";
import { memo, useMemo } from "react";
import { useMessageFormatter } from "@contember/react-i18n";
import { Link } from "./Link.js";
const navigationBackLinkDictionary = {
  navigationBackLink: {
    back: "Back"
  }
};
const NavigateBackLink = memo(({
  icon,
  ariaLabel,
  children,
  visuallyHidden = true,
  ...props
}) => {
  const formatMessage = useMessageFormatter(navigationBackLinkDictionary);
  const finalAriaLabel = typeof children === "string" ? children : ariaLabel ?? formatMessage("navigationBackLink.back");
  return /* @__PURE__ */ jsxDEV(Link, { Component: AnchorButton, componentProps: useMemo(() => ({ borderRadius: "full", distinction: "seamless" }), []), ...props, "aria-label": finalAriaLabel, children: /* @__PURE__ */ jsxDEV(Stack, { horizontal: true, align: "center", children: [
    icon ?? /* @__PURE__ */ jsxDEV(ArrowLeftIcon, {}, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/routing/NavigateBackLink.tsx",
      lineNumber: 43,
      columnNumber: 14
    }, void 0),
    /* @__PURE__ */ jsxDEV(VisuallyHidden, { hidden: visuallyHidden, children: children ?? formatMessage("navigationBackLink.back") }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/routing/NavigateBackLink.tsx",
      lineNumber: 44,
      columnNumber: 5
    }, void 0)
  ] }, void 0, true, {
    fileName: "/__w/interface/interface/packages/admin/src/routing/NavigateBackLink.tsx",
    lineNumber: 42,
    columnNumber: 4
  }, void 0) }, void 0, false, {
    fileName: "/__w/interface/interface/packages/admin/src/routing/NavigateBackLink.tsx",
    lineNumber: 41,
    columnNumber: 3
  }, void 0);
});
NavigateBackLink.displayName = "NavigateBackLink";
export {
  NavigateBackLink,
  navigationBackLinkDictionary
};
//# sourceMappingURL=NavigateBackLink.js.map
