'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 (
location.href='#dialog="settings"' } className="cursor-pointer" > 设置用户 location.href='#dialog="voice"' } className="cursor-pointer" > 语音设置 开源地址 托管地址 🤗 复制站点
版本信息 {pkg.version}
站点域名
copyToClipboard(host)} className="flex gap-1 text-xs text-zinc-500 cursor-pointer"> {host}
) }