'use client' import { useState, useEffect } from 'react' import dynamic from 'next/dynamic' import Link from 'next/link' import { usePathname } from 'next/navigation' import { useLocale } from 'next-intl' import { useAccount } from 'wagmi' import TelegramCard from '@/components/telegram/TelegramCard' import PageHint from '@/components/ui/PageHint' // BotConfigPanel is 867 lines and only needed after wallet connect — lazy load it. const BotConfigPanel = dynamic(() => import('@/components/trades/BotConfigPanel'), { ssr: false, loading: () =>
, }) /** * Settings page — the home for all configuration. * * Previously the BotConfigPanel lived on /trades (alongside the trade history), * and /settings was just a redirect card. That made /trades double-duty * (configure AND view results) and /settings feel like a dead end. We swap: * - /settings → all configuration (bot, exchange key, subscription) * - /trades → pure execution view (open positions + history) * Legal links stay here since this is the "everything else" page. */ export default function SettingsClient() { const localeIntl = useLocale() const isZh = false // i18n shelved — Chinese branches kept as dead code for future revival; see messages/zh.json const { address, isConnected } = useAccount() const [mounted, setMounted] = useState(false) const pathname = usePathname() useEffect(() => { setMounted(true) }, []) const locale = pathname.split('/')[1] || 'en' const href = (path: string) => `/${locale}${path}` const walletLabel = mounted && isConnected && address ? `${address.slice(0, 6)}…${address.slice(-4)}` : 'Not connected' return ( <>
Control center
One place to arm, limit, and verify the bot
Subscription, execution permissions, per-system risk, and alert delivery all live here.
Wallet {walletLabel}
Private data {mounted && isConnected ? 'Ready to unlock' : 'Connect first'}
Main actions Load settings, save limits, link API
Everything that controls your account — subscription, Hyperliquid API key, bot risk parameters, and Telegram alerts.
Trump settings control event-driven entries. Macro Vibes settings control BTC manage-only behavior. Global limits apply account-wide.
Trump Signal
Event-driven entry settings
Position size, Trump leverage, and minimum AI confidence used when a Truth Social post becomes actionable.
Configure Trump ↓
Macro Vibes
BTC manage-only settings
Strategy mode, BTC leverage, and de-risk behavior used by the Macro Vibes sleeve.
Configure Macro Vibes ↓
Global
Account-wide execution controls
Subscription, Hyperliquid API wallet, manual window, schedule, and guardrails that apply across the account.
Configure global ↓
{/* Account card — quick "who am I logged in as" */}
{isZh ? '账户' : 'Account'}
{mounted && isConnected ? '✓' : '○'}
{mounted && isConnected && address ? {address.slice(0, 10)}…{address.slice(-8)} : (isZh ? '未连接' : 'Not connected')}
{mounted && isConnected ? (isZh ? '钱包是下方所有配置的身份入口' : 'Wallet is the access key for everything below') : (isZh ? '连接钱包后才能配置机器人' : 'Connect a wallet to configure the bot')}
Execution setup
Trading permissions and risk controls
Load once, then adjust by module without leaving the page.
{/* The full bot config UI (subscribe, HL key, risk settings, schedule) */}
Delivery
Telegram alerts
Bind notifications after the trading path is configured.
Support
Legal and contact
{/* Legal & support */}
{isZh ? '法律与支持' : 'Legal & support'}
{isZh ? '隐私政策 →' : 'Privacy Policy →'} {isZh ? '服务条款 →' : 'Terms of Service →'} {isZh ? '联系我们 →' : 'Contact Us →'}
) }