'use client' import { useEffect, useState } from 'react' import Image from 'next/image' import { toast } from 'react-hot-toast' import { Button } from '@/components/ui/button' import pkg from '../../package.json' import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@/components/ui/dropdown-menu' import { IconCopy, IconExternalLink, IconGitHub } from '@/components/ui/icons' import SettingIcon from '@/assets/images/settings.svg' import { useCopyToClipboard } from '@/lib/hooks/use-copy-to-clipboard' export function UserMenu() { const [host, setHost] = useState('') const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 }) useEffect(() => { setHost(location.host) }, []) useEffect(() => { if (isCopied) { toast.success('复制成功') } }, [isCopied]) return (
) }