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