import { Avatar as NextAvatar, changeTheme, Dropdown, Text, useTheme, } from "@nextui-org/react"; const Avatar = (props) => { const { isDark } = useTheme(); const avatarUrl = props.avatarUrl || "https://cdn.fascinated.cc/IkQFyodbZv.jpg?raw=true"; const handleChange = () => { const nextTheme = isDark ? "light" : "dark"; window.localStorage.setItem("theme", nextTheme); // you can use any storage changeTheme(nextTheme); }; return ( <>
handleChange()}> Toggle Dark Mode
); }; export default Avatar;