import { FC } from "react"; import { Switch } from "@nextui-org/switch"; // Adjusted import for the new switch import { useTheme } from "next-themes"; import { useIsSSR } from "@react-aria/ssr"; import clsx from "clsx"; import { SunIcon, MoonIcon } from "@/components/icons"; // New icons export interface ThemeSwitchProps { className?: string; } export const ThemeSwitch: FC = ({ className }) => { const { theme, setTheme } = useTheme(); const isSSR = useIsSSR(); const onChange = () => { theme === "light" ? setTheme("dark") : setTheme("light"); }; return (
isSelected ? ( ) : ( ) } onChange={onChange} />
); };