import { jsx as o, Fragment as l } from "react/jsx-runtime";
import i, { useEffect as a } from "react";
import { Menu as r } from "semantic-ui-react";
const f = () => {
  const [n, e] = i.useState(!1);
  a(() => {
    const t = () => {
      window.pageYOffset > 150 ? e(!0) : e(!1);
    };
    return window.addEventListener("scroll", t), () => {
      window.removeEventListener("scroll", t);
    };
  }, [window.scroll]);
  const s = () => {
    document.body.scrollIntoView({ behavior: "smooth", block: "start", inline: "start" });
  };
  return /* @__PURE__ */ o(l, { children: n && /* @__PURE__ */ o("div", { id: "top-navigator", className: "top-navigator", children: /* @__PURE__ */ o(r, { children: /* @__PURE__ */ o(r.Item, { onClick: s, children: "Back to the top" }) }) }) });
};
export {
  f as default
};
