@theguild/components
Version:
18 lines (17 loc) • 468 B
JavaScript
"use client";
import { jsx } from "react/jsx-runtime";
import { useTheme } from "nextra-theme-docs";
const ThemeSwitcherButton = ({ children }) => {
const { resolvedTheme, setTheme } = useTheme();
return /* @__PURE__ */ jsx(
"button",
{
onClick: () => setTheme(resolvedTheme === "light" ? "dark" : "light"),
className: "self-center rounded-sm p-2 outline-none focus-visible:ring",
children
}
);
};
export {
ThemeSwitcherButton
};