import { jsxs as t, jsx as r } from "react/jsx-runtime";
import { useTheme as c, Box as o, Tooltip as s, Typography as f, IconButton as m } from "@mui/material";
import { Icon as u } from "@iconify/react";
import x from "@iconify-icons/material-symbols/lens";
import h from "../../WalletOSIcon/index.js";
import v from "../../Avatar/index.js";
import { DID as y } from "../../DID/index.js";
import { getSourceProvider as w } from "../libs/utils.js";
function T({
  ref: a = void 0,
  sessionItem: e,
  statusContent: n = null,
  active: d = !1,
  ...i
}) {
  const { palette: l } = c(), p = w(e?.user) === "wallet";
  return /* @__PURE__ */ t(
    o,
    {
      ...i,
      ref: a,
      sx: {
        display: "flex",
        alignItems: "center",
        justifyContent: "space-between",
        py: 0.75,
        px: 1,
        width: "100%",
        ...i?.sx
      },
      children: [
        /* @__PURE__ */ t(
          o,
          {
            sx: {
              display: "flex",
              alignItems: "center",
              gap: 0.5,
              overflow: "hidden",
              "& .did-address-avatar": {
                display: "none !important"
              }
            },
            children: [
              /* @__PURE__ */ r(o, { sx: { mr: 0.5, fontSize: 0 }, children: /* @__PURE__ */ r(v, { did: e.userDid, size: 36 }) }),
              /* @__PURE__ */ r(
                h,
                {
                  color: l.text.secondary,
                  loading: e.__isDefault,
                  provider: e?.extra?.provider,
                  walletOS: e?.extra?.walletOS
                }
              ),
              p ? /* @__PURE__ */ r(y, { did: e.userDid, copyable: !1, size: 14, responsive: !1, compact: !0, sx: { lineHeight: 1 } }) : e.user.email && /* @__PURE__ */ r(
                s,
                {
                  title: e.user.email,
                  sx: {
                    zIndex: 1600
                  },
                  placement: "top",
                  children: /* @__PURE__ */ r(
                    f,
                    {
                      sx: {
                        fontSize: 14,
                        overflow: "hidden",
                        textOverflow: "ellipsis"
                      },
                      children: e.user.email
                    }
                  )
                }
              )
            ]
          }
        ),
        n || d && /* @__PURE__ */ r(m, { size: "small", disableRipple: !0, children: /* @__PURE__ */ r(u, { icon: x, fontSize: 6, color: l.success.main }) })
      ]
    }
  );
}
export {
  T as default
};
