"use client"; import * as React from "react"; import { Moon, Sun } from "lucide-react"; import { useTheme } from "next-themes"; import { Button } from "@radix-ui/themes"; export function ModeToggle() { const { setTheme } = useTheme(); //get the current theme const { theme: themes } = useTheme(); //change theme from current to opposite const toggleTheme = () => { setTheme(themes === "light" ? "dark" : "light"); }; return ( ); }