"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("@emotion/react");
const React = require("react");
const jsxRuntime = require("@emotion/react/jsx-runtime");
const styles = require("./styles.js");
const index = require("../Avatar/index.js");
const close = require("../../assets/icon/close.png.js");
const logoHeader = require("../../assets/icon/logo-header.svg.js");
function _interopNamespaceDefault(e) {
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
  if (e) {
    for (const k in e) {
      if (k !== "default") {
        const d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: () => e[k]
        });
      }
    }
  }
  n.default = e;
  return Object.freeze(n);
}
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
const Header = ({
  topTip,
  defaultShowTopTip = false,
  controlShowTopTip,
  onClickLogo,
  customRightContent,
  userAvatar,
  userName
}) => {
  const [showNote, setShowNote] = React__namespace.useState(defaultShowTopTip);
  React__namespace.useEffect(() => {
    if (controlShowTopTip !== void 0) {
      setShowNote(controlShowTopTip);
    }
  }, [controlShowTopTip]);
  return /* @__PURE__ */ jsxRuntime.jsxs(styles.HeaderDiv, { children: [
    showNote ? /* @__PURE__ */ jsxRuntime.jsxs(styles.Note, { children: [
      topTip,
      /* @__PURE__ */ jsxRuntime.jsx(
        "img",
        {
          className: "closeIcon",
          onClick: () => {
            setShowNote(false);
          },
          src: close
        }
      )
    ] }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}),
    /* @__PURE__ */ jsxRuntime.jsxs(styles.RawHeaderDiv, { children: [
      /* @__PURE__ */ jsxRuntime.jsxs(styles.LeftBox, { children: [
        /* @__PURE__ */ jsxRuntime.jsx(styles.ImgLogo, { src: logoHeader, onClick: onClickLogo }),
        /* @__PURE__ */ jsxRuntime.jsx(styles.ImgLogoTxt, { children: "DataverseOS" })
      ] }),
      /* @__PURE__ */ jsxRuntime.jsx(styles.RigBox, { children: customRightContent || /* @__PURE__ */ jsxRuntime.jsxs(styles.LinkBox, { children: [
        /* @__PURE__ */ jsxRuntime.jsx(
          index.Avatar,
          {
            avatar: userAvatar,
            isOuter: true,
            className: "header-account-avatar"
          }
        ),
        /* @__PURE__ */ jsxRuntime.jsx(styles.AccountTxt, { children: userName })
      ] }) })
    ] })
  ] });
};
exports.Header = Header;
//# sourceMappingURL=index.js.map
