import { jsxs as r, jsx as t } from "react/jsx-runtime";
import { memo as g } from "react";
import { useMediaQuery as w, Box as n, Typography as y, Divider as C } from "@mui/material";
import { DID as S } from "../../DID/index.js";
import b from "./tooltip-avatar.js";
import { renderTopRight as v } from "../components.js";
import W from "./shorten-label.js";
import j from "../Cards/social-actions.js";
function A({ ...s }) {
  const {
    user: e,
    showDid: c,
    didProps: d,
    avatarSize: m,
    shouldShowHoverCard: p,
    renderCardContent: f,
    renderTopRightContent: l,
    topRightMaxWidth: h,
    avatarProps: x,
    shortenLabelProps: u,
    renderName: a,
    ...o
  } = s, i = w("(max-width:500px)");
  return /* @__PURE__ */ r(
    n,
    {
      className: "user-card__avatar-content",
      sx: {
        display: "flex",
        justifyContent: "space-between",
        alignItems: "center"
      },
      children: [
        /* @__PURE__ */ r(
          n,
          {
            sx: {
              display: "flex",
              justifyContent: "space-between",
              flexDirection: i ? "column" : "row",
              alignItems: i ? "flex-start" : "center",
              gap: i ? 2 : 1,
              flex: 1,
              minWidth: 0,
              flexWrap: "wrap"
            },
            children: [
              /* @__PURE__ */ r(n, { sx: { display: "flex", justifyContent: "flex-start", alignItems: "center", gap: 1, flex: 1 }, children: [
                /* @__PURE__ */ t(
                  b,
                  {
                    user: e,
                    avatarSize: m,
                    shouldShowHoverCard: p,
                    renderCardContent: f,
                    avatarProps: x,
                    ...o
                  }
                ),
                /* @__PURE__ */ r(n, { children: [
                  /* @__PURE__ */ t(
                    y,
                    {
                      variant: "subtitle1",
                      className: "user-card__full-name-label",
                      noWrap: !0,
                      sx: {
                        fontWeight: 500,
                        color: "text.primary",
                        fontSize: 18,
                        lineHeight: 1.1
                      },
                      children: a ? a(e) : /* @__PURE__ */ t(W, { sx: { fontWeight: 500 }, ...u, children: e.fullName || e.email || e.did })
                    }
                  ),
                  c && e.did ? /* @__PURE__ */ t(
                    S,
                    {
                      did: e.did,
                      size: 14,
                      copyable: !0,
                      compact: !0,
                      locale: "en",
                      sx: { lineHeight: 1.5 },
                      ...d ?? {}
                    }
                  ) : null
                ] })
              ] }),
              i && !l && o.showSocialActions ? /* @__PURE__ */ t(C, { sx: { width: "100%" } }) : null,
              l ? null : /* @__PURE__ */ t(
                j,
                {
                  onFollowClick: o.onFollowClick,
                  showSocialActions: o.showSocialActions,
                  user: e,
                  session: o.session
                }
              )
            ]
          }
        ),
        v(l, h)
      ]
    }
  );
}
const P = g(A);
export {
  P as default
};
