init: 初始化 AssetX 项目仓库

包含 webapp(Next.js 用户端)、webapp-back(Go 后端)、
antdesign(管理后台)、landingpage(营销落地页)、
数据库 SQL 和配置文件。
This commit is contained in:
2026-03-27 11:26:43 +00:00
commit 2ee4553b71
634 changed files with 988255 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
import { useAccount, useChainId } from 'wagmi'
import { useEffect, useState } from 'react'
/**
* 获取钱包连接状态的 Hook
* 带有客户端渲染保护
*/
export function useWalletStatus() {
const { address, isConnected, isConnecting } = useAccount()
const chainId = useChainId()
const [mounted, setMounted] = useState(false)
useEffect(() => {
setMounted(true)
}, [])
// 在 SSR 期间或未 mounted 时返回安全的默认值
if (!mounted) {
return {
address: undefined,
isConnected: false,
isConnecting: false,
chainId: undefined,
mounted: false,
}
}
return {
address,
isConnected,
isConnecting,
chainId,
mounted: true,
}
}