import { jsx, jsxs } from "react/jsx-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__ */ jsx(Link, { Component: AnchorButton, componentProps: useMemo(() => ({ borderRadius: "full", distinction: "seamless" }), []), ...props, "aria-label": finalAriaLabel, children: /* @__PURE__ */ jsxs(Stack, { horizontal: true, align: "center", children: [
    icon ?? /* @__PURE__ */ jsx(ArrowLeftIcon, {}),
    /* @__PURE__ */ jsx(VisuallyHidden, { hidden: visuallyHidden, children: children ?? formatMessage("navigationBackLink.back") })
  ] }) });
});
NavigateBackLink.displayName = "NavigateBackLink";
export {
  NavigateBackLink,
  navigationBackLinkDictionary
};
//# sourceMappingURL=NavigateBackLink.js.map
