import { TCopy } from "@/components/Copy"; import { TIcon } from "@/components/Icon"; import useHover from "@/hooks/useHover"; import { shortenAddress } from "@/utils/helper"; import clsx from "clsx"; import { useState } from "react"; // 添加 useState 引入 import SettingPopup from "../SettingPopup/SettingPopup"; export interface AccountInfoProps { name: string; address: string; icon?: React.ReactNode; iconSrc?: string; } interface PropsType { className?: string; accountInfo: AccountInfoProps; showSetting?: boolean; onChangePayPin?: () => void; onClose?: () => void; onBack?: () => void; } const AccountInfo = ({ accountInfo, showSetting = true, onChangePayPin, }: PropsType) => { // const copyMsg = "Copied to clipboard successfully"; const onCopyAddress = async () => { try { await navigator.clipboard.writeText(accountInfo.address); // Toast.show(copyMsg); } catch (err) { console.error("Failed to copy: ", err); } }; const [hoverRef, isHover] = useHover(); const [showSettingPopup, setShowSettingPopup] = useState(false); const onClose = () => { setShowSettingPopup(false); }; return (