"use client" import { useState, useEffect } from "react" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu" import { Button } from "@/components/ui/button" import { Settings, Moon, Sun } from 'lucide-react' import { useMobile } from "@/hooks/use-mobile" import { useTheme } from 'next-themes' export function SettingsDropdown() { const isMobile = useMobile() const [isDesktopView, setIsDesktopView] = useState(!isMobile) const { setTheme, theme } = useTheme() useEffect(() => { setIsDesktopView(!isMobile) }, [isMobile]) const handleToggleView = () => { setIsDesktopView((prev) => !prev) } const handleToggleTheme = () => { setTheme(theme === 'light' ? 'dark' : 'light') } return ( {isDesktopView ? "切换到移动端视图" : "切换到桌面端视图"} {theme === 'light' ? "切换到深色模式" : "切换到浅色模式"} {theme === 'light' ? : } ) }