import { jsxs as s, jsx as r } from "react/jsx-runtime";
import { useMemo as a } from "react";
import { Box as d, Typography as m } from "@mui/material";
import p from "prop-types";
import c from "@arcblock/ux/lib/UserCard";
import { withQuery as l, joinURL as f } from "ufo";
import { useMemoizedFn as u } from "ahooks";
import { BLOCKLET_SERVICE_PATH_PREFIX as x } from "../constant.js";
function h({ data: e }) {
  const { message: i, data: o } = e, t = a(() => new URLSearchParams(window.location.search).get("locale") || "en", []), n = u(() => {
    window.open(
      l(f(x, "user"), {
        locale: t,
        did: o.did
      }),
      "_blank"
    );
  });
  return /* @__PURE__ */ s(d, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
    /* @__PURE__ */ r(m, { sx: { fontSize: 14, color: "text.secondary" }, children: i }),
    /* @__PURE__ */ r(c, { showDid: !0, did: o.did, onAvatarClick: n })
  ] });
}
h.propTypes = {
  data: p.object.isRequired
};
export {
  h as default
};
