import { jsxs, jsx } from "react/jsx-runtime";
import classNames from "classnames";
import { ExternalIcon } from "@entur/icons";
import { getSpacingClasses } from "../utils/utils.mjs";
import '../../styles/components/text.css';/* empty css           */
const Link = ({
  external = false,
  ariaLabelExternalIcon = "(ekstern lenke)",
  className,
  spacing,
  children,
  as,
  ...rest
}) => {
  const LinkElement = as || "a";
  return /* @__PURE__ */ jsxs(
    LinkElement,
    {
      className: classNames(
        "eds-text--link",
        getSpacingClasses(spacing, "eds-text--link"),
        className
      ),
      ...rest,
      children: [
        children,
        external ? /* @__PURE__ */ jsx(
          ExternalIcon,
          {
            className: "eds-text--link--ext-icon",
            "aria-label": ariaLabelExternalIcon
          }
        ) : null
      ]
    }
  );
};
export {
  Link
};
//# sourceMappingURL=Link.mjs.map
