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