import { jsx as e } from "react/jsx-runtime";
import { IconButton as i } from "@mui/material";
import { Brightness2Outlined as l, LightModeOutlined as s } from "@mui/icons-material";
import { useThrottleFn as m } from "ahooks";
import { useColorScheme as u } from "../Theme/theme-provider.js";
function g() {
  const { mode: t, toggleMode: o, prefer: r } = u(), { run: n } = m(
    () => {
      o();
    },
    {
      wait: 300
    }
  );
  return o ? r === "system" || window.blocklet?.theme?.prefer === "system" ? /* @__PURE__ */ e(i, { onClick: n, children: t === "light" ? /* @__PURE__ */ e(l, {}) : /* @__PURE__ */ e(s, {}) }) : null : (process.env.NODE_ENV !== "production" && console.warn("Please ensure the component is wrapped with ConfigProvider context"), null);
}
export {
  g as default
};
