import { jsx as e, jsxs as f } from "react/jsx-runtime";
import "react";
import { Avatar as n } from "./index-Avatar.js";
import i from "./index-SocialMediaLink.module.scss.js";
import { classNames as a } from "./index-classNames.js";
import { Icon as p } from "./index-Icon.js";
import { IconNames as k } from "./index-IconNames.js";
import { detectNetworkFromUrl as u } from "./index-utils4.js";
const M = (l) => {
  const {
    network: s,
    url: r,
    testId: t,
    greyScale: c
  } = l, o = s || (r ? u(r) : void 0);
  if (!o)
    return null;
  const m = (d) => {
    d.stopPropagation();
  };
  return c ? e("div", {
    className: a(i.missingSocialMediaLink),
    "data-testid": t,
    children: e(n, {
      icon: o,
      size: "small",
      noHover: !0,
      greyScale: !0
    })
  }) : f("a", {
    href: r,
    target: "_blank",
    rel: "noopener noreferrer",
    className: a(i.socialMediaLink),
    "data-testid": t,
    onClick: m,
    children: [e(n, {
      icon: o,
      size: "small",
      noHover: !1
    }), e(p, {
      color: "--fn-fg-light",
      className: i.icon,
      children: k.newTab
    })]
  });
};
export {
  M as SocialMediaLink
};
