@microcosmmoney/portal-react 3.12.6 → 3.12.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -107,12 +107,10 @@ function MicrocosmMCDPage({ basePath = '', onNavigate }) {
|
|
|
107
107
|
const [showHelp, setShowHelp] = (0, react_1.useState)(false);
|
|
108
108
|
const [walletsExpanded, setWalletsExpanded] = (0, react_1.useState)(false);
|
|
109
109
|
const [refreshing, setRefreshing] = (0, react_1.useState)(false);
|
|
110
|
-
const mcdAmount = parseFloat(mcdData?.available_balance ?? '0');
|
|
111
|
-
const mcdReceived = parseFloat(mcdData?.total_balance ?? '0');
|
|
112
|
-
const mcdSpent = parseFloat(mcdData?.frozen_balance ?? '0');
|
|
113
110
|
const rewardsList = Array.isArray(rewards) ? rewards : [];
|
|
114
111
|
const txList = Array.isArray(transactions) ? transactions : [];
|
|
115
112
|
const walletList = Array.isArray(wallets) ? wallets : [];
|
|
113
|
+
const totalOnChainMCD = walletList.reduce((sum, w) => sum + (Number(w.mcd_balance) || 0), 0);
|
|
116
114
|
const resolvePath = (p) => basePath ? `${basePath.replace(/\/$/, '')}${p}` : p;
|
|
117
115
|
const handleRefresh = async () => {
|
|
118
116
|
setRefreshing(true);
|
|
@@ -133,9 +131,9 @@ function MicrocosmMCDPage({ basePath = '', onNavigate }) {
|
|
|
133
131
|
if (!mcdData && !mcdLoading) {
|
|
134
132
|
return ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center h-[60vh]", children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg p-8 text-center", children: [(0, jsx_runtime_1.jsx)(IconWallet, { className: "w-12 h-12 mx-auto mb-4 text-neutral-500" }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400", children: t('loginRequired', 'Please log in to view your MCD balance') })] }) }));
|
|
135
133
|
}
|
|
136
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-2 py-3 space-y-2 2xs:px-3 2xs:py-4 2xs:space-y-3 xs:px-4 xs:space-y-4 sm:px-6 sm:py-6 sm:space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between flex-wrap gap-1.5 2xs:gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-base 2xs:text-lg xs:text-
|
|
134
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-2 py-3 space-y-2 2xs:px-3 2xs:py-4 2xs:space-y-3 xs:px-4 xs:space-y-4 sm:px-6 sm:py-6 sm:space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between flex-wrap gap-1.5 2xs:gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-base 2xs:text-lg xs:text-lg sm:text-xl font-bold text-white tracking-wider", children: t('title', 'MCD Credits') }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-400 mt-1", children: t('subtitle', 'Microcosm Dollar - Ecosystem consumption credits') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 2xs:gap-1.5 sm:gap-2 flex-wrap", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => handleNav('/mcc/wallet'), className: "flex items-center px-2 2xs:px-3 py-1 2xs:py-1.5 text-[10px] 2xs:text-xs sm:text-sm border border-neutral-700 rounded text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent transition-colors whitespace-nowrap", children: [(0, jsx_runtime_1.jsx)(IconWallet, { className: "w-3 h-3 2xs:w-4 2xs:h-4 mr-1 2xs:mr-2" }), (0, jsx_runtime_1.jsx)("span", { className: "hidden 2xs:inline", children: t('manageWallet', 'Manage Wallet') }), (0, jsx_runtime_1.jsx)("span", { className: "2xs:hidden", children: t('manageWallet', 'Wallet') })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => setShowHelp(!showHelp), className: "flex items-center px-2 2xs:px-3 py-1 2xs:py-1.5 text-[10px] 2xs:text-xs sm:text-sm border border-neutral-700 rounded text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent transition-colors whitespace-nowrap", children: [(0, jsx_runtime_1.jsx)(IconHelpCircle, { className: "w-3 h-3 2xs:w-4 2xs:h-4 mr-1 2xs:mr-2" }), (0, jsx_runtime_1.jsx)("span", { className: "hidden 2xs:inline", children: t('helpGuide', 'Help Guide') }), (0, jsx_runtime_1.jsx)("span", { className: "2xs:hidden", children: t('helpGuide', 'Help') })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleRefresh, disabled: refreshing, className: "flex items-center px-2 2xs:px-3 py-1 2xs:py-1.5 text-[10px] 2xs:text-xs sm:text-sm border border-neutral-700 rounded text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent transition-colors disabled:opacity-50 whitespace-nowrap", children: [(0, jsx_runtime_1.jsx)(IconRefresh, { className: `w-3 h-3 2xs:w-4 2xs:h-4 mr-1 2xs:mr-2 ${refreshing ? 'animate-spin' : ''}` }), t('refresh', 'Refresh')] })] })] }), showHelp && ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg p-2 2xs:p-3 sm:p-4 md:p-6 hover:border-cyan-400/50 transition-colors", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-bold tracking-wider mb-2 2xs:mb-3 sm:mb-4 text-xs 2xs:text-sm sm:text-base", children: t('mcdGuideTitle', 'MCD Credits Guide') }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-2 2xs:space-y-3 sm:space-y-4 text-[10px] 2xs:text-xs sm:text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 2xs:p-3", children: [(0, jsx_runtime_1.jsxs)("h4", { className: "font-medium text-white mb-1.5 2xs:mb-2 flex items-center gap-1.5 2xs:gap-2 text-xs 2xs:text-sm", children: [(0, jsx_runtime_1.jsx)(IconGift, { className: "w-3.5 h-3.5 2xs:w-4 2xs:h-4 text-white shrink-0" }), t('howToGetMcd', 'How to Earn MCD')] }), (0, jsx_runtime_1.jsxs)("ul", { className: "list-disc list-inside text-neutral-400 space-y-1", children: [(0, jsx_runtime_1.jsx)("li", { children: "Daily distribution from territory vault (1% of vault balance)" }), (0, jsx_runtime_1.jsx)("li", { children: "Companion yield from mining operations" }), (0, jsx_runtime_1.jsx)("li", { children: "Ecosystem service rewards" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 2xs:p-3", children: [(0, jsx_runtime_1.jsxs)("h4", { className: "font-medium text-white mb-1.5 2xs:mb-2 flex items-center gap-1.5 2xs:gap-2 text-xs 2xs:text-sm", children: [(0, jsx_runtime_1.jsx)(IconCoins, { className: "w-3.5 h-3.5 2xs:w-4 2xs:h-4 text-white shrink-0" }), t('mcdUsage', 'MCD Usage')] }), (0, jsx_runtime_1.jsxs)("ul", { className: "list-disc list-inside text-neutral-400 space-y-1", children: [(0, jsx_runtime_1.jsx)("li", { children: "Spend on ecosystem services (Double Helix, xSocial, etc.)" }), (0, jsx_runtime_1.jsx)("li", { children: "Transfer between users" }), (0, jsx_runtime_1.jsx)("li", { children: "Future governance participation" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 2xs:p-3", children: [(0, jsx_runtime_1.jsxs)("h4", { className: "font-medium text-white mb-1.5 2xs:mb-2 flex items-center gap-1.5 2xs:gap-2 text-xs 2xs:text-sm", children: [(0, jsx_runtime_1.jsx)(IconHistory, { className: "w-3.5 h-3.5 2xs:w-4 2xs:h-4 text-white shrink-0" }), t('notes', 'Notes')] }), (0, jsx_runtime_1.jsxs)("ul", { className: "list-disc list-inside text-neutral-400 space-y-1", children: [(0, jsx_runtime_1.jsx)("li", { children: "MCD is an internal ecosystem token, not tradeable on exchanges" }), (0, jsx_runtime_1.jsx)("li", { children: "Daily distribution happens automatically at 00:15 UTC" }), (0, jsx_runtime_1.jsx)("li", { children: "Check your territory page for vault balance details" })] })] })] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg p-2 2xs:p-3 sm:p-4 md:p-6 hover:border-cyan-400/50 transition-colors", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2 mb-2 2xs:mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 min-w-0", children: [(0, jsx_runtime_1.jsx)(IconCoins, { className: "w-4 h-4 2xs:w-5 2xs:h-5 text-white shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs 2xs:text-sm text-neutral-400 tracking-wider truncate", children: t('onChainBalance', 'On-chain MCD Balance') })] }), walletList.length > 1 && ((0, jsx_runtime_1.jsxs)("button", { onClick: () => setWalletsExpanded(!walletsExpanded), className: "flex items-center text-[10px] 2xs:text-xs sm:text-sm text-neutral-400 hover:text-cyan-400 transition-colors whitespace-nowrap shrink-0", children: [walletList.length, " ", t('walletsCount', 'wallets'), walletsExpanded
|
|
137
135
|
? (0, jsx_runtime_1.jsx)(IconChevronUp, { className: "w-3 h-3 2xs:w-4 2xs:h-4 ml-1" })
|
|
138
|
-
: (0, jsx_runtime_1.jsx)(IconChevronDown, { className: "w-3 h-3 2xs:w-4 2xs:h-4 ml-1" })] }))] }), walletsLoading ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(Spinner, {}), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 text-[10px] 2xs:text-xs sm:text-sm", children: t('loadingOnChain', 'Loading on-chain balance...') })] })) : walletList.length === 0 ? ((0, jsx_runtime_1.jsxs)("div", { className: "text-center py-3 2xs:py-4", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 mb-2 2xs:mb-3 text-[10px] 2xs:text-xs sm:text-sm", children: t('noWalletBound', 'No Solana wallet bound yet') }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => handleNav('/mcc/wallet'), className: "flex items-center mx-auto px-2 2xs:px-3 py-1 2xs:py-1.5 text-[10px] 2xs:text-xs sm:text-sm border border-neutral-700 rounded text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent transition-colors whitespace-nowrap", children: [(0, jsx_runtime_1.jsx)(IconWallet, { className: "w-3 h-3 2xs:w-4 2xs:h-4 mr-1 2xs:mr-2" }), t('connectWallet', 'Connect Wallet')] })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [walletList.length === 1 && ((0, jsx_runtime_1.jsxs)("div", { className: "mt-2 text-[10px] 2xs:text-xs text-neutral-500 font-mono flex items-center gap-2 flex-wrap", children: [(0, jsx_runtime_1.jsxs)("span", { className: "truncate", children: [(0, jsx_runtime_1.jsxs)("span", { className: "2xs:hidden", children: [walletList[0].wallet_address.slice(0, 4), "...", walletList[0].wallet_address.slice(-4)] }), (0, jsx_runtime_1.jsxs)("span", { className: "hidden 2xs:inline sm:hidden", children: [walletList[0].wallet_address.slice(0, 6), "...", walletList[0].wallet_address.slice(-6)] }), (0, jsx_runtime_1.jsxs)("span", { className: "hidden sm:inline", children: [walletList[0].wallet_address.slice(0, 8), "...", walletList[0].wallet_address.slice(-8)] })] }), walletList[0].is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "inline-block text-[9px] 2xs:text-[10px] border border-cyan-400/30 text-cyan-400 px-1 2xs:px-1.5 py-0 rounded", children: t('primaryWallet', 'Primary') }))] })), walletsExpanded && walletList.length > 1 && ((0, jsx_runtime_1.jsx)("div", { className: "mt-3 2xs:mt-4 space-y-1.5 2xs:space-y-2 border-t border-neutral-700 pt-3 2xs:pt-4", children: walletList.map((w) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2 p-1.5 2xs:p-2 bg-neutral-800 rounded hover:bg-neutral-700 transition-colors", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 min-w-0", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-[10px] 2xs:text-xs font-mono text-neutral-400 truncate", children: [(0, jsx_runtime_1.jsxs)("span", { className: "2xs:hidden", children: [w.wallet_address.slice(0, 4), "...", w.wallet_address.slice(-4)] }), (0, jsx_runtime_1.jsxs)("span", { className: "hidden 2xs:inline sm:hidden", children: [w.wallet_address.slice(0, 6), "...", w.wallet_address.slice(-6)] }), (0, jsx_runtime_1.jsxs)("span", { className: "hidden sm:inline", children: [w.wallet_address.slice(0, 8), "...", w.wallet_address.slice(-8)] })] }), w.is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "inline-block text-[9px] 2xs:text-[10px] border border-cyan-400/30 text-cyan-400 px-1 2xs:px-1.5 py-0 rounded shrink-0", children: t('primaryWallet', 'Primary') }))] }), (0, jsx_runtime_1.
|
|
136
|
+
: (0, jsx_runtime_1.jsx)(IconChevronDown, { className: "w-3 h-3 2xs:w-4 2xs:h-4 ml-1" })] }))] }), walletsLoading ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(Spinner, {}), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 text-[10px] 2xs:text-xs sm:text-sm", children: t('loadingOnChain', 'Loading on-chain balance...') })] })) : walletList.length === 0 ? ((0, jsx_runtime_1.jsxs)("div", { className: "text-center py-3 2xs:py-4", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 mb-2 2xs:mb-3 text-[10px] 2xs:text-xs sm:text-sm", children: t('noWalletBound', 'No Solana wallet bound yet') }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => handleNav('/mcc/wallet'), className: "flex items-center mx-auto px-2 2xs:px-3 py-1 2xs:py-1.5 text-[10px] 2xs:text-xs sm:text-sm border border-neutral-700 rounded text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent transition-colors whitespace-nowrap", children: [(0, jsx_runtime_1.jsx)(IconWallet, { className: "w-3 h-3 2xs:w-4 2xs:h-4 mr-1 2xs:mr-2" }), t('connectWallet', 'Connect Wallet')] })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-xl 2xs:text-2xl xs:text-2xl sm:text-3xl font-bold text-white font-mono mb-1 truncate", children: [fmt(totalOnChainMCD), (0, jsx_runtime_1.jsx)("span", { className: "text-xs 2xs:text-sm sm:text-base text-neutral-400 ml-2", children: "MCD" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[10px] 2xs:text-xs text-neutral-500", children: [walletList.length, " ", t('walletsCount', 'wallets')] }), walletList.length === 1 && ((0, jsx_runtime_1.jsxs)("div", { className: "mt-2 text-[10px] 2xs:text-xs text-neutral-500 font-mono flex items-center gap-2 flex-wrap", children: [(0, jsx_runtime_1.jsxs)("span", { className: "truncate", children: [(0, jsx_runtime_1.jsxs)("span", { className: "2xs:hidden", children: [walletList[0].wallet_address.slice(0, 4), "...", walletList[0].wallet_address.slice(-4)] }), (0, jsx_runtime_1.jsxs)("span", { className: "hidden 2xs:inline sm:hidden", children: [walletList[0].wallet_address.slice(0, 6), "...", walletList[0].wallet_address.slice(-6)] }), (0, jsx_runtime_1.jsxs)("span", { className: "hidden sm:inline", children: [walletList[0].wallet_address.slice(0, 8), "...", walletList[0].wallet_address.slice(-8)] })] }), walletList[0].is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "inline-block text-[9px] 2xs:text-[10px] border border-cyan-400/30 text-cyan-400 px-1 2xs:px-1.5 py-0 rounded", children: t('primaryWallet', 'Primary') }))] })), walletsExpanded && walletList.length > 1 && ((0, jsx_runtime_1.jsx)("div", { className: "mt-3 2xs:mt-4 space-y-1.5 2xs:space-y-2 border-t border-neutral-700 pt-3 2xs:pt-4", children: walletList.map((w) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2 p-1.5 2xs:p-2 bg-neutral-800 rounded hover:bg-neutral-700 transition-colors", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 min-w-0", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-[10px] 2xs:text-xs font-mono text-neutral-400 truncate", children: [(0, jsx_runtime_1.jsxs)("span", { className: "2xs:hidden", children: [w.wallet_address.slice(0, 4), "...", w.wallet_address.slice(-4)] }), (0, jsx_runtime_1.jsxs)("span", { className: "hidden 2xs:inline sm:hidden", children: [w.wallet_address.slice(0, 6), "...", w.wallet_address.slice(-6)] }), (0, jsx_runtime_1.jsxs)("span", { className: "hidden sm:inline", children: [w.wallet_address.slice(0, 8), "...", w.wallet_address.slice(-8)] })] }), w.is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "inline-block text-[9px] 2xs:text-[10px] border border-cyan-400/30 text-cyan-400 px-1 2xs:px-1.5 py-0 rounded shrink-0", children: t('primaryWallet', 'Primary') }))] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-xs 2xs:text-sm font-mono text-white shrink-0", children: [fmt(Number(w.mcd_balance) || 0), " MCD"] })] }, w.wallet_address))) }))] }))] }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 sm:p-4 md:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 mb-1", children: [(0, jsx_runtime_1.jsx)(IconTrendingUp, { className: "w-4 h-4 2xs:w-5 2xs:h-5 text-white shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs 2xs:text-sm font-medium text-neutral-300 tracking-wider", children: t('mcdMinting', 'MCD Minting') })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 text-[10px] 2xs:text-xs sm:text-sm mb-2 2xs:mb-3 sm:mb-4", children: t('mintMccWithMcd', 'Consume MCD to mint MCC Token') }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => handleNav('/mcc/mining'), className: "w-full flex items-center justify-center gap-1.5 2xs:gap-2 h-9 2xs:h-10 rounded-md bg-cyan-700 hover:bg-cyan-600 transition-all text-white text-xs 2xs:text-sm font-medium cursor-pointer whitespace-nowrap", children: [(0, jsx_runtime_1.jsx)(IconCoins, { className: "w-3.5 h-3.5 2xs:w-4 2xs:h-4" }), t('useMcdToMintMcc', 'Mint MCC with MCD')] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-2 2xs:mt-3 p-2 2xs:p-3 bg-neutral-800 rounded", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-1.5 2xs:gap-2 text-[10px] 2xs:text-xs text-cyan-400/70", children: [(0, jsx_runtime_1.jsx)(IconAlertTriangle, { className: "w-3 h-3 2xs:w-3.5 2xs:h-3.5 mt-0.5 shrink-0 text-cyan-400" }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-1", children: [(0, jsx_runtime_1.jsx)("p", { children: t('whitelistNote1', 'MCD mining is open to all registered miners') }), (0, jsx_runtime_1.jsx)("p", { children: t('whitelistNote2', 'Mining price = base price x 4, MCD companion yield included') })] })] }) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 sm:p-4 md:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 mb-1", children: [(0, jsx_runtime_1.jsx)(IconGift, { className: "w-4 h-4 2xs:w-5 2xs:h-5 text-white shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs 2xs:text-sm font-medium text-neutral-300 tracking-wider", children: t('ecoServices', 'Ecosystem Services') })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 text-[10px] 2xs:text-xs sm:text-sm mb-2 2xs:mb-3 sm:mb-4", children: t('ecoServicesDesc', 'Use MCD to access ecosystem project services') }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 2xs:grid-cols-2 sm:grid-cols-2 md:grid-cols-3 gap-1.5 2xs:gap-2 sm:gap-3 md:gap-4", children: ECOSYSTEM_SERVICES.map((p) => ((0, jsx_runtime_1.jsxs)("a", { href: p.url, target: "_blank", rel: "noopener noreferrer", className: "block p-2 2xs:p-3 sm:p-4 bg-neutral-800 rounded-lg hover:bg-neutral-700 transition-colors group", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 2xs:gap-3 mb-2 2xs:mb-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-7 h-7 2xs:w-8 2xs:h-8 sm:w-10 sm:h-10 rounded-lg bg-cyan-400/20 flex items-center justify-center shrink-0", children: (0, jsx_runtime_1.jsx)(p.Icon, { className: "w-3.5 h-3.5 2xs:w-4 2xs:h-4 sm:w-5 sm:h-5 text-cyan-400" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 min-w-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-medium text-white text-xs 2xs:text-sm truncate", children: p.name }), (0, jsx_runtime_1.jsx)(IconExternalLink, { className: "w-3 h-3 text-neutral-600 opacity-0 group-hover:opacity-100 transition-opacity shrink-0" })] }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] 2xs:text-xs text-neutral-500 truncate block", children: p.tagline })] }), (0, jsx_runtime_1.jsx)("span", { className: `text-[9px] 2xs:text-[10px] ${p.statusColor} shrink-0`, children: p.status })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs text-neutral-400 leading-relaxed", children: p.desc })] }, p.name))) })] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 border border-neutral-700 rounded-lg p-1 inline-flex flex-wrap", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => setActiveTab('daily'), className: `flex items-center px-2 2xs:px-3 sm:px-4 py-1.5 2xs:py-2 text-[10px] 2xs:text-xs sm:text-sm rounded-md transition-colors whitespace-nowrap ${activeTab === 'daily'
|
|
139
137
|
? 'bg-neutral-700 text-white'
|
|
140
138
|
: 'text-neutral-400 hover:text-neutral-300'}`, children: [(0, jsx_runtime_1.jsx)(IconGift, { className: "w-3 h-3 2xs:w-4 2xs:h-4 mr-1 2xs:mr-2" }), t('dailyDistribution', 'Daily Distribution')] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => setActiveTab('history'), className: `flex items-center px-2 2xs:px-3 sm:px-4 py-1.5 2xs:py-2 text-[10px] 2xs:text-xs sm:text-sm rounded-md transition-colors whitespace-nowrap ${activeTab === 'history'
|
|
141
139
|
? 'bg-neutral-700 text-white'
|
|
@@ -84,24 +84,14 @@ function MicrocosmMiningPage({ basePath = '', onNavigate }) {
|
|
|
84
84
|
const primaryWallet = walletList.find((w) => w.is_primary);
|
|
85
85
|
const primaryAddress = primaryWallet?.wallet_address ?? null;
|
|
86
86
|
const totalBalance = walletList.length > 0 ? walletList.reduce((sum, w) => sum + (w.mcc_balance ?? 0), 0) : mccBalance;
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (!primaryAddress) {
|
|
91
|
-
setMineError(t('noBoundWallet', 'No bound wallet. Please bind a wallet in Profile first.'));
|
|
92
|
-
return;
|
|
87
|
+
const handleMine = (0, react_1.useCallback)(() => {
|
|
88
|
+
if (typeof window !== 'undefined') {
|
|
89
|
+
window.open('https://m.microcosm.money', '_blank', 'noopener,noreferrer');
|
|
93
90
|
}
|
|
94
|
-
|
|
95
|
-
await startMining({ amount: 1, wallet_address: primaryAddress });
|
|
96
|
-
refreshRecords();
|
|
97
|
-
}
|
|
98
|
-
catch (err) {
|
|
99
|
-
setMineError(err instanceof Error ? err.message : String(err));
|
|
100
|
-
}
|
|
101
|
-
}, [startMining, primaryAddress, refreshRecords, t]);
|
|
91
|
+
}, []);
|
|
102
92
|
const isLoading = mccStatsLoading && !mccStats;
|
|
103
93
|
if (isLoading) {
|
|
104
94
|
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-2 py-3 space-y-2 2xs:px-3 2xs:py-4 2xs:space-y-3 sm:px-6 sm:py-6 sm:space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-base 2xs:text-lg xs:text-xl sm:text-2xl md:text-3xl font-bold text-white tracking-wider", children: t('title', 'Mining') }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-400 mt-1", children: t('subtitle', 'MCC minting via X402 protocol') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center py-12", children: [(0, jsx_runtime_1.jsx)(Spinner, { className: "mr-3" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-sm", children: t('loadingMintData', 'Loading mining data...') })] })] }));
|
|
105
95
|
}
|
|
106
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-2 py-3 space-y-2 2xs:px-3 2xs:py-4 2xs:space-y-3 sm:px-6 sm:py-6 sm:space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-base 2xs:text-lg xs:text-xl sm:text-2xl md:text-3xl font-bold text-white tracking-wider", children: t('title', 'Mining') }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-400 mt-1", children: t('subtitle', 'MCC minting via X402 protocol') })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => refreshRecords(), className: "inline-flex items-center gap-1 2xs:gap-2 px-2 py-1.5 2xs:px-3 2xs:py-2 sm:px-4 sm:py-2.5 text-[10px] 2xs:text-xs sm:text-sm border border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent rounded-md transition-colors whitespace-nowrap flex-shrink-0", children: [(0, jsx_runtime_1.jsx)(IconRefresh, { className: mccStatsLoading ? 'animate-spin' : '' }), t('refresh', 'Refresh')] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl p-3 2xs:p-4 sm:p-5 md:p-6 blockchain-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "space-y-3 2xs:space-y-4 mb-3 2xs:mb-4 md:mb-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center flex-wrap gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-[10px] 2xs:text-xs bg-white/20 text-white px-2 py-0.5 rounded font-medium whitespace-nowrap", children: t('x402Protocol', 'X402 Protocol') }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] 2xs:text-xs bg-cyan-400/20 text-cyan-400 px-2 py-0.5 rounded font-medium whitespace-nowrap", children: "Solana Mainnet" })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-[#5EEAD4] tracking-widest uppercase mb-1.5", children: "MINING_PRICE" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-baseline gap-2 flex-wrap", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl md:text-4xl font-bold text-cyan-400 font-mono whitespace-nowrap", children: ["1 MCC = ", miningPrice > 0 ? fmt(miningPrice, 4) : '--', " USD"] }), (0, jsx_runtime_1.jsx)("span", { className: "text-[9px] 2xs:text-[10px] bg-cyan-400/20 text-cyan-400 px-1.5 py-0.5 rounded whitespace-nowrap", children: "base \u00D7 4" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center flex-wrap gap-x-4 gap-y-1 text-[10px] 2xs:text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 whitespace-nowrap", children: [(0, jsx_runtime_1.jsx)(IconShield, { className: "w-3.5 h-3.5 text-neutral-500 flex-shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('stablecoinDirectDesc', 'Stablecoin direct payment') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 whitespace-nowrap", children: [(0, jsx_runtime_1.jsx)(IconZap, { className: "w-3.5 h-3.5 text-neutral-500 flex-shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('instantMintDesc', 'Instant on-chain minting') })] })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleMine, disabled: miningLoading || !primaryAddress, className: "w-full inline-flex items-center justify-center gap-2 px-4 py-3 sm:py-4 text-sm sm:text-base font-medium bg-cyan-700 hover:bg-cyan-600 text-white rounded-md whitespace-nowrap disabled:opacity-50 transition-colors", children: [(0, jsx_runtime_1.jsx)(IconZap, { className: "w-4 h-4 sm:w-5 sm:h-5" }), miningLoading ? t('processing', 'Processing...') : t('startMinting', 'Start Minting')] }), mineError && ((0, jsx_runtime_1.jsx)("div", { className: "bg-red-900/20 border border-red-800 rounded p-2 2xs:p-3 text-[10px] 2xs:text-xs text-red-300", children: mineError }))] }), (0, jsx_runtime_1.jsx)("div", { className: "border-t border-neutral-700 pt-2 2xs:pt-3 sm:pt-4 mb-2 2xs:mb-3 sm:mb-4", children: (0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-xs text-[#5EEAD4] tracking-widest uppercase mb-1.5 2xs:mb-2 sm:mb-3", children: "MINING STATISTICS" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 lg:grid-cols-4 gap-1.5 2xs:gap-2 sm:gap-3 mb-2 2xs:mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 2xs:gap-1.5 sm:gap-2 mb-1.5 2xs:mb-2", children: [(0, jsx_runtime_1.jsx)(IconTrendingUp, {}), (0, jsx_runtime_1.jsx)("span", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase truncate", children: "CURRENT EPOCH" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-cyan-400 font-mono", children: ["#", currentEpochNum] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-500 mt-1 truncate", children: [fmtCompact(epochYield), " MCC / epoch"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 2xs:gap-1.5 sm:gap-2 mb-1.5 2xs:mb-2", children: [(0, jsx_runtime_1.jsx)(IconCoins, {}), (0, jsx_runtime_1.jsxs)("span", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase truncate", children: ["HALVING ", displayPhase] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-white font-mono", children: [halvingRatio, ":1"] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-500 mt-1 tabular-nums truncate", children: [fmtCompact(totalMinted), " / ", fmtCompact(nextHalving)] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-1.5 2xs:mt-2 h-1 2xs:h-1.5 bg-neutral-900 rounded-full overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "h-full bg-cyan-400 rounded-full transition-all", style: { width: `${Math.min(halvingProgress, 100)}%` } }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1 2xs:gap-1.5 sm:gap-2 mb-1.5 2xs:mb-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase truncate", children: "mining_rate" }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-cyan-400 font-mono", children: miningRate > 0 ? `${miningRate}:1` : '--' }), (0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-500 mt-1 truncate", children: "USD to MCC ratio" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1 2xs:gap-1.5 sm:gap-2 mb-1.5 2xs:mb-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase truncate", children: "MINING VAULT" }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-white font-mono", children: fmtCompact(miningVaultMcc) }), (0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-500 mt-1 truncate", children: "MCC available" })] })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl p-2 2xs:p-3 sm:p-4 md:p-6 blockchain-card", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-between mb-1.5 2xs:mb-2 sm:mb-3 gap-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 sm:gap-3 min-w-0", children: [(0, jsx_runtime_1.jsx)(IconWallet, { className: "text-white flex-shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-300 tracking-wider font-medium truncate", children: t('onChainBalance', 'On-Chain Balance') }), walletList.length > 0 && ((0, jsx_runtime_1.jsxs)("span", { className: "inline-flex items-center gap-1 text-[8px] 2xs:text-[9px] sm:text-xs bg-white/20 text-white px-1 2xs:px-1.5 py-0.5 rounded flex-shrink-0", children: [(0, jsx_runtime_1.jsx)(IconCheckCircle, {}), walletList.length] }))] }) }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 text-[9px] 2xs:text-[10px] sm:text-xs mb-1.5 2xs:mb-2 sm:mb-3 md:mb-4", children: t('onChainBalanceDesc', 'Real-time on-chain MCC balance across all bound wallets') }), walletsLoading && walletList.length === 0 ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center py-8", children: [(0, jsx_runtime_1.jsx)(Spinner, { className: "mr-2" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-sm", children: t('loadingOnChainBalance', 'Loading on-chain balance...') })] })) : walletList.length === 0 ? ((0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase mb-1 font-mono", children: "total_balance" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold font-mono text-white", children: [fmt(mccBalance, 3), " MCC"] }), primaryAddress && ((0, jsx_runtime_1.jsxs)("div", { className: "text-neutral-500 text-[9px] 2xs:text-[10px] sm:text-xs mt-1 font-mono truncate", children: [primaryAddress.slice(0, 4), "...", primaryAddress.slice(-4)] }))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 2xs:grid-cols-2 gap-1.5 2xs:gap-2 sm:gap-3 mb-2 2xs:mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase mb-1 font-mono truncate", children: "total_on_chain" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold font-mono text-white", children: [fmt(totalBalance), " MCC"] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-neutral-500 text-[9px] 2xs:text-[10px] sm:text-xs mt-1 truncate", children: [walletList.length, " ", t('walletsTotal', 'wallets total')] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase mb-1 font-mono truncate", children: "primary_wallet" }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold font-mono text-white", children: primaryWallet ? fmt(primaryWallet.mcc_balance ?? 0) : '--' }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-[9px] 2xs:text-[10px] sm:text-xs mt-1 truncate font-mono", children: primaryAddress ? `${primaryAddress.slice(0, 4)}...${primaryAddress.slice(-4)}` : t('noPrimaryWallet', 'No primary wallet') })] })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => setWalletsExpanded(!walletsExpanded), className: "flex items-center gap-1.5 2xs:gap-2 text-[10px] 2xs:text-xs text-neutral-400 hover:text-cyan-400 transition-colors mb-1.5 2xs:mb-2", children: [walletsExpanded ? (0, jsx_runtime_1.jsx)(IconChevronUp, {}) : (0, jsx_runtime_1.jsx)(IconChevronDown, {}), walletsExpanded ? t('collapse', 'Collapse') : t('expand', 'Expand'), " (", walletList.length, ")"] }), walletsExpanded && ((0, jsx_runtime_1.jsx)("div", { className: "space-y-1.5 2xs:space-y-2", children: walletList.map((w) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between px-2 py-1.5 2xs:px-3 2xs:p-2 bg-neutral-800 rounded hover:bg-neutral-700 text-[10px] 2xs:text-xs transition-colors gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 2xs:gap-2 min-w-0", children: [(0, jsx_runtime_1.jsx)(IconWallet, { className: "w-3 h-3 text-neutral-500 flex-shrink-0" }), (0, jsx_runtime_1.jsxs)("a", { href: `https://solscan.io/account/${w.wallet_address}`, target: "_blank", rel: "noopener noreferrer", className: "text-neutral-300 hover:text-white truncate font-mono", children: [w.wallet_address.slice(0, 4), "...", w.wallet_address.slice(-4)] }), w.is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "px-1 py-0.5 bg-cyan-400/20 text-cyan-400 rounded text-[8px] 2xs:text-[9px] flex-shrink-0", children: t('primaryLabel', 'Primary') }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 2xs:gap-2 flex-shrink-0", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-white font-mono font-medium text-[10px] 2xs:text-xs", children: fmt(w.mcc_balance ?? 0) }), (0, jsx_runtime_1.jsx)("a", { href: `https://solscan.io/account/${w.wallet_address}`, target: "_blank", rel: "noopener noreferrer", className: "text-neutral-600 hover:text-neutral-400", children: (0, jsx_runtime_1.jsx)(IconExternalLink, {}) })] })] }, w.wallet_address))) }))] }))] }), (0, jsx_runtime_1.jsx)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl blockchain-card", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 sm:p-4 md:p-6", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => setShowRecords(!showRecords), className: "w-full flex items-center justify-between group gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 sm:gap-3 min-w-0", children: [(0, jsx_runtime_1.jsx)(IconHistory, {}), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-300 tracking-wider font-medium truncate", children: t('mintRecords', 'Mining Records') }), recordsTotal > 0 && ((0, jsx_runtime_1.jsx)("span", { className: "text-[8px] 2xs:text-[9px] sm:text-xs bg-neutral-500/20 text-neutral-300 px-1 2xs:px-1.5 py-0.5 rounded flex-shrink-0", children: recordsTotal }))] }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1 text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-400 group-hover:text-cyan-400 transition-colors flex-shrink-0", children: showRecords ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [t('collapse', 'Collapse'), " ", (0, jsx_runtime_1.jsx)(IconChevronUp, {})] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [t('expand', 'Expand'), " ", (0, jsx_runtime_1.jsx)(IconChevronDown, {})] })) })] }), showRecords && ((0, jsx_runtime_1.jsxs)("div", { className: "mt-2 2xs:mt-3 sm:mt-4 pt-2 2xs:pt-3 sm:pt-4 border-t border-neutral-700", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 text-[9px] 2xs:text-[10px] sm:text-xs mb-1.5 2xs:mb-2 sm:mb-3 md:mb-4", children: t('allRecordsDesc', 'All x402 non-custodial minting transaction records') }), recordsLoading ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-6 2xs:py-8", children: (0, jsx_runtime_1.jsx)(Spinner, {}) })) : records.length > 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "overflow-x-auto", children: (0, jsx_runtime_1.jsxs)("table", { className: "w-full text-[10px] 2xs:text-xs sm:text-sm", children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { className: "text-neutral-400 text-[9px] 2xs:text-[10px] sm:text-xs border-b border-neutral-700", children: [(0, jsx_runtime_1.jsx)("th", { className: "text-left py-1.5 2xs:py-2 font-normal hidden xs:table-cell", children: t('colTime', 'Time') }), (0, jsx_runtime_1.jsx)("th", { className: "text-right py-1.5 2xs:py-2 font-normal hidden sm:table-cell", children: t('payment', 'Paid') }), (0, jsx_runtime_1.jsx)("th", { className: "text-left xs:text-right py-1.5 2xs:py-2 font-normal", children: t('earnedMcc', 'Minted') }), (0, jsx_runtime_1.jsx)("th", { className: "text-right py-1.5 2xs:py-2 font-normal", children: t('colStatus', 'Status') })] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: records.map((r, i) => ((0, jsx_runtime_1.jsxs)("tr", { className: "border-b border-neutral-800 hover:bg-neutral-800/50", children: [(0, jsx_runtime_1.jsx)("td", { className: "py-2 2xs:py-3 text-neutral-300 font-mono text-[9px] 2xs:text-[10px] sm:text-xs hidden xs:table-cell", children: formatDateTime(r.mined_at ?? r.created_at ?? r.timestamp) }), (0, jsx_runtime_1.jsxs)("td", { className: "py-2 2xs:py-3 text-right text-white font-mono hidden sm:table-cell", children: [fmt(r.paid_amount ?? r.payment_amount ?? r.stablecoin_amount ?? 0), " ", r.stablecoin ?? r.payment_type ?? 'USDC'] }), (0, jsx_runtime_1.jsxs)("td", { className: "py-2 2xs:py-3 text-left xs:text-right text-cyan-400 font-mono", children: [(0, jsx_runtime_1.jsx)("div", { className: "xs:hidden text-[8px] 2xs:text-[9px] text-neutral-500 mb-0.5 font-mono", children: formatDateTime(r.mined_at ?? r.created_at ?? r.timestamp) }), "+", fmt(r.mcc_amount ?? r.minted ?? 0), " MCC", (0, jsx_runtime_1.jsxs)("div", { className: "sm:hidden text-[8px] 2xs:text-[9px] text-neutral-500 mt-0.5 font-mono", children: [fmt(r.paid_amount ?? r.payment_amount ?? r.stablecoin_amount ?? 0), " ", r.stablecoin ?? r.payment_type ?? 'USDC'] })] }), (0, jsx_runtime_1.jsx)("td", { className: "py-2 2xs:py-3 text-right", children: (0, jsx_runtime_1.jsx)("a", { href: r.tx_signature ? `https://solscan.io/tx/${r.tx_signature}` : undefined, target: "_blank", rel: "noopener noreferrer", className: "text-[8px] 2xs:text-[9px] sm:text-xs px-1 2xs:px-1.5 py-0.5 rounded bg-white/20 text-white hover:bg-cyan-400/30 hover:text-cyan-200 transition-colors whitespace-nowrap", children: t('completed', 'confirmed') }) })] }, r.tx_signature ?? `${recordsPage}-${i}`))) })] }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-6 2xs:py-8 text-neutral-500 text-[10px] 2xs:text-xs sm:text-sm", children: t('noMintRecords', 'No mining records yet') })), recordsTotal > RECORDS_PAGE_SIZE && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mt-2 2xs:mt-3 sm:mt-4 pt-2 2xs:pt-3 sm:pt-4 border-t border-neutral-800 text-[9px] 2xs:text-[10px] sm:text-xs gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-500 font-mono truncate", children: [recordsPage, "/", recordsTotalPages, " \u00B7 ", recordsTotal] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-1 2xs:gap-2 flex-shrink-0", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => setRecordsPage(p => Math.max(1, p - 1)), disabled: recordsPage <= 1 || recordsLoading, className: "px-2 2xs:px-3 py-1 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-white rounded disabled:opacity-40 disabled:cursor-not-allowed transition-colors", children: ["\u2039 ", t('prevPage', 'Prev')] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => setRecordsPage(p => Math.min(recordsTotalPages, p + 1)), disabled: recordsPage >= recordsTotalPages || recordsLoading, className: "px-2 2xs:px-3 py-1 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-white rounded disabled:opacity-40 disabled:cursor-not-allowed transition-colors", children: [t('nextPage', 'Next'), " \u203A"] })] })] }))] }))] }) }), s?.pool_mcc_bought != null && ((0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl p-2 2xs:p-3 sm:p-4 md:p-6 blockchain-card", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-xs text-[#5EEAD4] tracking-widest uppercase mb-1.5 2xs:mb-2 sm:mb-3", children: "POOL STATUS" }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 2xs:grid-cols-2 lg:grid-cols-3 gap-1.5 2xs:gap-2 sm:gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase font-mono truncate", children: "total_market_made" }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm 2xs:text-base sm:text-lg font-bold text-white font-mono", children: fmt(s.pool_mcc_bought ?? 0) }), (0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-500 mt-1 truncate", children: "MCC bought via CPMM" })] }), s?.pool_usdc_balance != null && ((0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase font-mono truncate", children: "stablecoin_pool" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-sm 2xs:text-base sm:text-lg font-bold text-white font-mono", children: ["$", fmt((s.pool_usdc_balance ?? 0) + (s.pool_usdt_balance ?? 0))] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-500 mt-1 truncate", children: ["USDT ", fmt(s.pool_usdt_balance ?? 0), " / USDC ", fmt(s.pool_usdc_balance ?? 0)] })] })), s?.pool_tvl != null && ((0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase font-mono truncate", children: "tvl" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-sm 2xs:text-base sm:text-lg font-bold text-white font-mono", children: ["$", fmt(s.pool_tvl ?? 0)] }), (0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-500 mt-1 truncate", children: "Total value locked" })] }))] })] })), stats && ((0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl p-2 2xs:p-3 sm:p-4 md:p-6 blockchain-card", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-xs text-[#5EEAD4] tracking-widest uppercase mb-1.5 2xs:mb-2 sm:mb-3 md:mb-4 font-mono", children: "MY_MINING_STATS" }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 lg:grid-cols-4 gap-1.5 2xs:gap-2 sm:gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase font-mono truncate", children: "total_mined" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-sm 2xs:text-base sm:text-lg font-bold text-white font-mono", children: [fmt(stats.total_mined ?? 0), " MCC"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase font-mono truncate", children: "total_paid" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-sm 2xs:text-base sm:text-lg font-bold text-white font-mono", children: [fmt(stats.total_paid ?? 0), " USDC"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase font-mono truncate", children: "mining_count" }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm 2xs:text-base sm:text-lg font-bold text-white font-mono", children: stats.mining_count ?? 0 })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase font-mono truncate", children: "active_days" }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm 2xs:text-base sm:text-lg font-bold text-white font-mono", children: stats.active_days_30d ?? 0 })] })] })] })), (0, jsx_runtime_1.jsx)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl p-2 2xs:p-3 sm:p-4 md:p-6 blockchain-card", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-1.5 2xs:gap-2 text-neutral-400 text-[10px] 2xs:text-xs sm:text-sm", children: [(0, jsx_runtime_1.jsx)(IconShield, { className: "w-3.5 h-3.5 2xs:w-4 2xs:h-4 text-white mt-0.5 flex-shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('securityNote', 'All transactions are executed on-chain via X402 protocol. Your private keys never leave your wallet. Microcosm uses non-custodial minting with atomic on-chain verification.') })] }) })] }));
|
|
96
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-2 py-3 space-y-2 2xs:px-3 2xs:py-4 2xs:space-y-3 sm:px-6 sm:py-6 sm:space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-base 2xs:text-lg xs:text-xl sm:text-2xl md:text-3xl font-bold text-white tracking-wider", children: t('title', 'Mining') }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-400 mt-1", children: t('subtitle', 'MCC minting via X402 protocol') })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => refreshRecords(), className: "inline-flex items-center gap-1 2xs:gap-2 px-2 py-1.5 2xs:px-3 2xs:py-2 sm:px-4 sm:py-2.5 text-[10px] 2xs:text-xs sm:text-sm border border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent rounded-md transition-colors whitespace-nowrap flex-shrink-0", children: [(0, jsx_runtime_1.jsx)(IconRefresh, { className: mccStatsLoading ? 'animate-spin' : '' }), t('refresh', 'Refresh')] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl p-3 2xs:p-4 sm:p-5 md:p-6 blockchain-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "space-y-3 2xs:space-y-4 mb-3 2xs:mb-4 md:mb-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center flex-wrap gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-[10px] 2xs:text-xs bg-white/20 text-white px-2 py-0.5 rounded font-medium whitespace-nowrap", children: t('x402Protocol', 'X402 Protocol') }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] 2xs:text-xs bg-cyan-400/20 text-cyan-400 px-2 py-0.5 rounded font-medium whitespace-nowrap", children: "Solana Mainnet" })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-[#5EEAD4] tracking-widest uppercase mb-1.5", children: "MINING_PRICE" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-baseline gap-2 flex-wrap", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl md:text-4xl font-bold text-cyan-400 font-mono whitespace-nowrap", children: ["1 MCC = ", miningPrice > 0 ? fmt(miningPrice, 4) : '--', " USD"] }), (0, jsx_runtime_1.jsx)("span", { className: "text-[9px] 2xs:text-[10px] bg-cyan-400/20 text-cyan-400 px-1.5 py-0.5 rounded whitespace-nowrap", children: "base \u00D7 4" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center flex-wrap gap-x-4 gap-y-1 text-[10px] 2xs:text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 whitespace-nowrap", children: [(0, jsx_runtime_1.jsx)(IconShield, { className: "w-3.5 h-3.5 text-neutral-500 flex-shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('stablecoinDirectDesc', 'Stablecoin direct payment') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 whitespace-nowrap", children: [(0, jsx_runtime_1.jsx)(IconZap, { className: "w-3.5 h-3.5 text-neutral-500 flex-shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('instantMintDesc', 'Instant on-chain minting') })] })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleMine, className: "w-full inline-flex items-center justify-center gap-2 px-4 py-3 sm:py-4 text-sm sm:text-base font-medium bg-cyan-700 hover:bg-cyan-600 text-white rounded-md whitespace-nowrap transition-colors", children: [(0, jsx_runtime_1.jsx)(IconZap, { className: "w-4 h-4 sm:w-5 sm:h-5" }), t('startMinting', 'Start Minting')] })] }), (0, jsx_runtime_1.jsx)("div", { className: "border-t border-neutral-700 pt-2 2xs:pt-3 sm:pt-4 mb-2 2xs:mb-3 sm:mb-4", children: (0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-xs text-[#5EEAD4] tracking-widest uppercase mb-1.5 2xs:mb-2 sm:mb-3", children: "MINING STATISTICS" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 lg:grid-cols-4 gap-1.5 2xs:gap-2 sm:gap-3 mb-2 2xs:mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 2xs:gap-1.5 sm:gap-2 mb-1.5 2xs:mb-2", children: [(0, jsx_runtime_1.jsx)(IconTrendingUp, {}), (0, jsx_runtime_1.jsx)("span", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase truncate", children: "CURRENT EPOCH" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-cyan-400 font-mono", children: ["#", currentEpochNum] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-500 mt-1 truncate", children: [fmtCompact(epochYield), " MCC / epoch"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 2xs:gap-1.5 sm:gap-2 mb-1.5 2xs:mb-2", children: [(0, jsx_runtime_1.jsx)(IconCoins, {}), (0, jsx_runtime_1.jsxs)("span", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase truncate", children: ["HALVING ", displayPhase] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-white font-mono", children: [halvingRatio, ":1"] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-500 mt-1 tabular-nums truncate", children: [fmtCompact(totalMinted), " / ", fmtCompact(nextHalving)] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-1.5 2xs:mt-2 h-1 2xs:h-1.5 bg-neutral-900 rounded-full overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "h-full bg-cyan-400 rounded-full transition-all", style: { width: `${Math.min(halvingProgress, 100)}%` } }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1 2xs:gap-1.5 sm:gap-2 mb-1.5 2xs:mb-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase truncate", children: "mining_rate" }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-cyan-400 font-mono", children: miningRate > 0 ? `${miningRate}:1` : '--' }), (0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-500 mt-1 truncate", children: "USD to MCC ratio" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1 2xs:gap-1.5 sm:gap-2 mb-1.5 2xs:mb-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase truncate", children: "MINING VAULT" }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-white font-mono", children: fmtCompact(miningVaultMcc) }), (0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-500 mt-1 truncate", children: "MCC available" })] })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl p-2 2xs:p-3 sm:p-4 md:p-6 blockchain-card", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-between mb-1.5 2xs:mb-2 sm:mb-3 gap-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 sm:gap-3 min-w-0", children: [(0, jsx_runtime_1.jsx)(IconWallet, { className: "text-white flex-shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-300 tracking-wider font-medium truncate", children: t('onChainBalance', 'On-Chain Balance') }), walletList.length > 0 && ((0, jsx_runtime_1.jsxs)("span", { className: "inline-flex items-center gap-1 text-[8px] 2xs:text-[9px] sm:text-xs bg-white/20 text-white px-1 2xs:px-1.5 py-0.5 rounded flex-shrink-0", children: [(0, jsx_runtime_1.jsx)(IconCheckCircle, {}), walletList.length] }))] }) }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 text-[9px] 2xs:text-[10px] sm:text-xs mb-1.5 2xs:mb-2 sm:mb-3 md:mb-4", children: t('onChainBalanceDesc', 'Real-time on-chain MCC balance across all bound wallets') }), walletsLoading && walletList.length === 0 ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center py-8", children: [(0, jsx_runtime_1.jsx)(Spinner, { className: "mr-2" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-sm", children: t('loadingOnChainBalance', 'Loading on-chain balance...') })] })) : walletList.length === 0 ? ((0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase mb-1 font-mono", children: "total_balance" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold font-mono text-white", children: [fmt(mccBalance, 3), " MCC"] }), primaryAddress && ((0, jsx_runtime_1.jsxs)("div", { className: "text-neutral-500 text-[9px] 2xs:text-[10px] sm:text-xs mt-1 font-mono truncate", children: [primaryAddress.slice(0, 4), "...", primaryAddress.slice(-4)] }))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 2xs:grid-cols-2 gap-1.5 2xs:gap-2 sm:gap-3 mb-2 2xs:mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase mb-1 font-mono truncate", children: "total_on_chain" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold font-mono text-white", children: [fmt(totalBalance), " MCC"] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-neutral-500 text-[9px] 2xs:text-[10px] sm:text-xs mt-1 truncate", children: [walletList.length, " ", t('walletsTotal', 'wallets total')] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase mb-1 font-mono truncate", children: "primary_wallet" }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold font-mono text-white", children: primaryWallet ? fmt(primaryWallet.mcc_balance ?? 0) : '--' }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-[9px] 2xs:text-[10px] sm:text-xs mt-1 truncate font-mono", children: primaryAddress ? `${primaryAddress.slice(0, 4)}...${primaryAddress.slice(-4)}` : t('noPrimaryWallet', 'No primary wallet') })] })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => setWalletsExpanded(!walletsExpanded), className: "flex items-center gap-1.5 2xs:gap-2 text-[10px] 2xs:text-xs text-neutral-400 hover:text-cyan-400 transition-colors mb-1.5 2xs:mb-2", children: [walletsExpanded ? (0, jsx_runtime_1.jsx)(IconChevronUp, {}) : (0, jsx_runtime_1.jsx)(IconChevronDown, {}), walletsExpanded ? t('collapse', 'Collapse') : t('expand', 'Expand'), " (", walletList.length, ")"] }), walletsExpanded && ((0, jsx_runtime_1.jsx)("div", { className: "space-y-1.5 2xs:space-y-2", children: walletList.map((w) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between px-2 py-1.5 2xs:px-3 2xs:p-2 bg-neutral-800 rounded hover:bg-neutral-700 text-[10px] 2xs:text-xs transition-colors gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 2xs:gap-2 min-w-0", children: [(0, jsx_runtime_1.jsx)(IconWallet, { className: "w-3 h-3 text-neutral-500 flex-shrink-0" }), (0, jsx_runtime_1.jsxs)("a", { href: `https://solscan.io/account/${w.wallet_address}`, target: "_blank", rel: "noopener noreferrer", className: "text-neutral-300 hover:text-white truncate font-mono", children: [w.wallet_address.slice(0, 4), "...", w.wallet_address.slice(-4)] }), w.is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "px-1 py-0.5 bg-cyan-400/20 text-cyan-400 rounded text-[8px] 2xs:text-[9px] flex-shrink-0", children: t('primaryLabel', 'Primary') }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 2xs:gap-2 flex-shrink-0", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-white font-mono font-medium text-[10px] 2xs:text-xs", children: fmt(w.mcc_balance ?? 0) }), (0, jsx_runtime_1.jsx)("a", { href: `https://solscan.io/account/${w.wallet_address}`, target: "_blank", rel: "noopener noreferrer", className: "text-neutral-600 hover:text-neutral-400", children: (0, jsx_runtime_1.jsx)(IconExternalLink, {}) })] })] }, w.wallet_address))) }))] }))] }), (0, jsx_runtime_1.jsx)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl blockchain-card", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 sm:p-4 md:p-6", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => setShowRecords(!showRecords), className: "w-full flex items-center justify-between group gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 sm:gap-3 min-w-0", children: [(0, jsx_runtime_1.jsx)(IconHistory, {}), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-300 tracking-wider font-medium truncate", children: t('mintRecords', 'Mining Records') }), recordsTotal > 0 && ((0, jsx_runtime_1.jsx)("span", { className: "text-[8px] 2xs:text-[9px] sm:text-xs bg-neutral-500/20 text-neutral-300 px-1 2xs:px-1.5 py-0.5 rounded flex-shrink-0", children: recordsTotal }))] }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1 text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-400 group-hover:text-cyan-400 transition-colors flex-shrink-0", children: showRecords ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [t('collapse', 'Collapse'), " ", (0, jsx_runtime_1.jsx)(IconChevronUp, {})] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [t('expand', 'Expand'), " ", (0, jsx_runtime_1.jsx)(IconChevronDown, {})] })) })] }), showRecords && ((0, jsx_runtime_1.jsxs)("div", { className: "mt-2 2xs:mt-3 sm:mt-4 pt-2 2xs:pt-3 sm:pt-4 border-t border-neutral-700", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 text-[9px] 2xs:text-[10px] sm:text-xs mb-1.5 2xs:mb-2 sm:mb-3 md:mb-4", children: t('allRecordsDesc', 'All x402 non-custodial minting transaction records') }), recordsLoading ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-6 2xs:py-8", children: (0, jsx_runtime_1.jsx)(Spinner, {}) })) : records.length > 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "overflow-x-auto", children: (0, jsx_runtime_1.jsxs)("table", { className: "w-full text-[10px] 2xs:text-xs sm:text-sm", children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { className: "text-neutral-400 text-[9px] 2xs:text-[10px] sm:text-xs border-b border-neutral-700", children: [(0, jsx_runtime_1.jsx)("th", { className: "text-left py-1.5 2xs:py-2 font-normal hidden xs:table-cell", children: t('colTime', 'Time') }), (0, jsx_runtime_1.jsx)("th", { className: "text-right py-1.5 2xs:py-2 font-normal hidden sm:table-cell", children: t('payment', 'Paid') }), (0, jsx_runtime_1.jsx)("th", { className: "text-left xs:text-right py-1.5 2xs:py-2 font-normal", children: t('earnedMcc', 'Minted') }), (0, jsx_runtime_1.jsx)("th", { className: "text-right py-1.5 2xs:py-2 font-normal", children: t('colStatus', 'Status') })] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: records.map((r, i) => ((0, jsx_runtime_1.jsxs)("tr", { className: "border-b border-neutral-800 hover:bg-neutral-800/50", children: [(0, jsx_runtime_1.jsx)("td", { className: "py-2 2xs:py-3 text-neutral-300 font-mono text-[9px] 2xs:text-[10px] sm:text-xs hidden xs:table-cell", children: formatDateTime(r.mined_at ?? r.created_at ?? r.timestamp) }), (0, jsx_runtime_1.jsxs)("td", { className: "py-2 2xs:py-3 text-right text-white font-mono hidden sm:table-cell", children: [fmt(r.paid_amount ?? r.payment_amount ?? r.stablecoin_amount ?? 0), " ", r.stablecoin ?? r.payment_type ?? 'USDC'] }), (0, jsx_runtime_1.jsxs)("td", { className: "py-2 2xs:py-3 text-left xs:text-right text-cyan-400 font-mono", children: [(0, jsx_runtime_1.jsx)("div", { className: "xs:hidden text-[8px] 2xs:text-[9px] text-neutral-500 mb-0.5 font-mono", children: formatDateTime(r.mined_at ?? r.created_at ?? r.timestamp) }), "+", fmt(r.mcc_amount ?? r.minted ?? 0), " MCC", (0, jsx_runtime_1.jsxs)("div", { className: "sm:hidden text-[8px] 2xs:text-[9px] text-neutral-500 mt-0.5 font-mono", children: [fmt(r.paid_amount ?? r.payment_amount ?? r.stablecoin_amount ?? 0), " ", r.stablecoin ?? r.payment_type ?? 'USDC'] })] }), (0, jsx_runtime_1.jsx)("td", { className: "py-2 2xs:py-3 text-right", children: (0, jsx_runtime_1.jsx)("a", { href: r.tx_signature ? `https://solscan.io/tx/${r.tx_signature}` : undefined, target: "_blank", rel: "noopener noreferrer", className: "text-[8px] 2xs:text-[9px] sm:text-xs px-1 2xs:px-1.5 py-0.5 rounded bg-white/20 text-white hover:bg-cyan-400/30 hover:text-cyan-200 transition-colors whitespace-nowrap", children: t('completed', 'confirmed') }) })] }, r.tx_signature ?? `${recordsPage}-${i}`))) })] }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-6 2xs:py-8 text-neutral-500 text-[10px] 2xs:text-xs sm:text-sm", children: t('noMintRecords', 'No mining records yet') })), recordsTotal > RECORDS_PAGE_SIZE && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mt-2 2xs:mt-3 sm:mt-4 pt-2 2xs:pt-3 sm:pt-4 border-t border-neutral-800 text-[9px] 2xs:text-[10px] sm:text-xs gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-500 font-mono truncate", children: [recordsPage, "/", recordsTotalPages, " \u00B7 ", recordsTotal] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-1 2xs:gap-2 flex-shrink-0", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => setRecordsPage(p => Math.max(1, p - 1)), disabled: recordsPage <= 1 || recordsLoading, className: "px-2 2xs:px-3 py-1 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-white rounded disabled:opacity-40 disabled:cursor-not-allowed transition-colors", children: ["\u2039 ", t('prevPage', 'Prev')] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => setRecordsPage(p => Math.min(recordsTotalPages, p + 1)), disabled: recordsPage >= recordsTotalPages || recordsLoading, className: "px-2 2xs:px-3 py-1 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-white rounded disabled:opacity-40 disabled:cursor-not-allowed transition-colors", children: [t('nextPage', 'Next'), " \u203A"] })] })] }))] }))] }) }), s?.pool_mcc_bought != null && ((0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl p-2 2xs:p-3 sm:p-4 md:p-6 blockchain-card", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-xs text-[#5EEAD4] tracking-widest uppercase mb-1.5 2xs:mb-2 sm:mb-3", children: "POOL STATUS" }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 2xs:grid-cols-2 lg:grid-cols-3 gap-1.5 2xs:gap-2 sm:gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase font-mono truncate", children: "total_market_made" }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm 2xs:text-base sm:text-lg font-bold text-white font-mono", children: fmt(s.pool_mcc_bought ?? 0) }), (0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-500 mt-1 truncate", children: "MCC bought via CPMM" })] }), s?.pool_usdc_balance != null && ((0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase font-mono truncate", children: "stablecoin_pool" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-sm 2xs:text-base sm:text-lg font-bold text-white font-mono", children: ["$", fmt((s.pool_usdc_balance ?? 0) + (s.pool_usdt_balance ?? 0))] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-500 mt-1 truncate", children: ["USDT ", fmt(s.pool_usdt_balance ?? 0), " / USDC ", fmt(s.pool_usdc_balance ?? 0)] })] })), s?.pool_tvl != null && ((0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase font-mono truncate", children: "tvl" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-sm 2xs:text-base sm:text-lg font-bold text-white font-mono", children: ["$", fmt(s.pool_tvl ?? 0)] }), (0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-500 mt-1 truncate", children: "Total value locked" })] }))] })] })), stats && ((0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl p-2 2xs:p-3 sm:p-4 md:p-6 blockchain-card", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-xs text-[#5EEAD4] tracking-widest uppercase mb-1.5 2xs:mb-2 sm:mb-3 md:mb-4 font-mono", children: "MY_MINING_STATS" }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 lg:grid-cols-4 gap-1.5 2xs:gap-2 sm:gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase font-mono truncate", children: "total_mined" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-sm 2xs:text-base sm:text-lg font-bold text-white font-mono", children: [fmt(stats.total_mined ?? 0), " MCC"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase font-mono truncate", children: "total_paid" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-sm 2xs:text-base sm:text-lg font-bold text-white font-mono", children: [fmt(stats.total_paid ?? 0), " USDC"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase font-mono truncate", children: "mining_count" }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm 2xs:text-base sm:text-lg font-bold text-white font-mono", children: stats.mining_count ?? 0 })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-2.5 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-[#5EEAD4] tracking-widest uppercase font-mono truncate", children: "active_days" }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm 2xs:text-base sm:text-lg font-bold text-white font-mono", children: stats.active_days_30d ?? 0 })] })] })] })), (0, jsx_runtime_1.jsx)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl p-2 2xs:p-3 sm:p-4 md:p-6 blockchain-card", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-1.5 2xs:gap-2 text-neutral-400 text-[10px] 2xs:text-xs sm:text-sm", children: [(0, jsx_runtime_1.jsx)(IconShield, { className: "w-3.5 h-3.5 2xs:w-4 2xs:h-4 text-white mt-0.5 flex-shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('securityNote', 'All transactions are executed on-chain via X402 protocol. Your private keys never leave your wallet. Microcosm uses non-custodial minting with atomic on-chain verification.') })] }) })] }));
|
|
107
97
|
}
|
|
@@ -208,5 +208,5 @@ function MicrocosmWalletPage({ basePath = '', onNavigate }) {
|
|
|
208
208
|
? 'bg-cyan-700 text-white'
|
|
209
209
|
: 'bg-neutral-800 text-neutral-400 hover:text-white hover:bg-neutral-700'}`, children: [t('overview', 'Overview'), " (", walletList.length, " ", t('wallets', 'wallets'), ")"] }), walletList.map((w) => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => setActiveTab(w.wallet_address), className: `px-2 2xs:px-3 py-1 2xs:py-1.5 text-[10px] 2xs:text-xs rounded whitespace-nowrap transition-colors flex items-center gap-1 ${activeTab === w.wallet_address
|
|
210
210
|
? 'bg-cyan-700 text-white'
|
|
211
|
-
: 'bg-neutral-800 text-neutral-400 hover:text-white hover:bg-neutral-700'}`, children: [(0, jsx_runtime_1.jsxs)("code", { className: "font-mono", children: [w.wallet_address.slice(0, 4), "...", w.wallet_address.slice(-4)] }), w.is_primary && (0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400 text-[9px] 2xs:text-[10px]", children: t('primary', 'Primary') })] }, w.wallet_address)))] })), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 text-neutral-400 text-xs 2xs:text-sm mb-1.5 2xs:mb-2 sm:mb-3 md:mb-4", children: [(0, jsx_runtime_1.jsx)(IconCreditCard, { className: "text-cyan-400 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('onChainAssets', 'On-Chain Assets') }), multiLoading && (0, jsx_runtime_1.jsx)(Spinner, { size: "w-3 h-3" })] }), multiLoading ? ((0, jsx_runtime_1.jsx)("div", { className: "py-10", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center gap-3", children: [(0, jsx_runtime_1.jsx)(Spinner, { size: "w-6 h-6" }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('syncingOnChainData', 'Syncing on-chain data...') }), (0, jsx_runtime_1.jsx)("div", { className: "w-48 h-1 bg-neutral-800 rounded-full overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "h-full bg-cyan-400/60 rounded-full animate-pulse", style: { width: '60%' } }) })] }) })) : ((0, jsx_runtime_1.jsx)(AssetList, { holdings: activeHoldings, hideBalance: hideBalance, showWalletColumn: showWalletCol, isLoading: multiLoading })), (0, jsx_runtime_1.jsx)("div", { className: "mt-3 2xs:mt-4 pt-2 2xs:pt-3 border-t border-neutral-700 space-y-1.5 2xs:space-y-2", children: isAllTab ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-1.5 2xs:gap-2 text-[10px] 2xs:text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(IconInfo, { className: "mt-0.5 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('allWalletsNote', 'Aggregated on-chain balances across {count} wallets. Low-value assets (<$1) are hidden.', { count: walletList.length }) })] })) : ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-1.5 2xs:space-y-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2 flex-wrap", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 text-[10px] 2xs:text-xs text-neutral-500 min-w-0", children: [(0, jsx_runtime_1.jsx)(IconInfo, { className: "shrink-0" }), (0, jsx_runtime_1.jsxs)("span", { className: "hidden 2xs:inline", children: [t('currentWallet', 'Current wallet'), ":"] }), (0, jsx_runtime_1.jsx)("code", { className: "text-neutral-400 bg-neutral-800 px-1.5 py-0.5 rounded font-mono truncate min-w-0 max-w-[140px] 2xs:max-w-[180px] sm:max-w-none", children: activeTab }), walletList.find((w) => w.wallet_address === activeTab)?.is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400 bg-cyan-400/20 px-1.5 py-0.5 rounded text-[9px] 2xs:text-[10px] shrink-0", children: t('primary', 'Primary') }))] }), (0, jsx_runtime_1.jsxs)("a", { href: `https://solscan.io/account/${activeTab}`, target: "_blank", rel: "noopener noreferrer", className: "text-cyan-400 hover:text-cyan-300 text-[10px] 2xs:text-xs flex items-center gap-1 whitespace-nowrap", children: [t('viewOnSolscan', 'View on Solscan'), " ", (0, jsx_runtime_1.jsx)(IconExternalLink, { className: "w-3 h-3" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-1.5 2xs:gap-2 text-[10px] 2xs:text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(IconInfo, { className: "mt-0.5 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('singleWalletNote', 'Showing on-chain balances for this wallet only. Low-value assets (<$1) are hidden.') })] })] })) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-3 2xs:p-4 sm:p-5 md:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-3 mb-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "p-2 2xs:p-3 bg-cyan-400/20 rounded-xl border border-cyan-400/30 shrink-0", children: (0, jsx_runtime_1.jsx)(IconWallet, { className: "w-5 h-5 2xs:w-6 2xs:h-6 sm:w-8 sm:h-8 text-cyan-400" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0 flex-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-400 tracking-wider mb-1", children: t('mccBalance', 'MCC Balance') }), (0, jsx_runtime_1.jsx)("div", { className: "text-xl 2xs:text-2xl xs:text-3xl sm:text-4xl md:text-5xl font-bold text-white font-mono truncate", children: mccLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : mask(fmt(mccBalance)) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-500 mt-1 truncate", children: [mccLoading ? '' : mask(`${fmtUSD(totalUsd)}`), !mccLoading && price > 0 && ((0, jsx_runtime_1.jsxs)("span", { className: "ml-2 text-[10px] 2xs:text-xs text-neutral-600", children: ["@ ", fmtUSD(price), "/MCC"] }))] })] })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => onNavigate?.(resolvePath('/mcc/mining')), className: "w-full flex items-center justify-center gap-2 px-4 py-2 sm:py-2.5 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-xs 2xs:text-sm transition-colors whitespace-nowrap", children: [(0, jsx_runtime_1.jsx)(IconExternalLink, { className: "h-4 w-4" }), t('mintRecords', 'Mining Records')] }), walletList.length > 1 && mccData?.wallets && mccData.wallets.length > 1 && ((0, jsx_runtime_1.jsx)("div", { className: "mt-3 2xs:mt-4 space-y-1.5 2xs:space-y-2", children: mccData.wallets.map((wb) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2 p-2 2xs:p-3 bg-neutral-800 rounded border border-neutral-700 text-xs 2xs:text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 min-w-0", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-400 font-mono truncate", children: [(0, jsx_runtime_1.jsxs)("span", { className: "2xs:hidden", children: [wb.wallet_address.slice(0, 4), "...", wb.wallet_address.slice(-4)] }), (0, jsx_runtime_1.jsxs)("span", { className: "hidden 2xs:inline sm:hidden", children: [wb.wallet_address.slice(0, 6), "...", wb.wallet_address.slice(-4)] }), (0, jsx_runtime_1.jsxs)("span", { className: "hidden sm:inline", children: [wb.wallet_address.slice(0, 8), "...", wb.wallet_address.slice(-8)] })] }), wb.is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "text-[9px] 2xs:text-[10px] bg-cyan-400/20 text-cyan-400 px-1 2xs:px-1.5 py-0.5 rounded shrink-0", children: "PRIMARY" }))] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-cyan-400 font-mono font-bold whitespace-nowrap shrink-0", children: [mask(fmt(wb.balance ?? 0, 3)), " MCC"] })] }, wb.wallet_address))) }))] }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 sm:p-4 md:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 text-neutral-400 text-xs 2xs:text-sm mb-1.5 2xs:mb-2 sm:mb-3 md:mb-4", children: [(0, jsx_runtime_1.jsx)(IconGift, { className: "text-cyan-400 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('mcdPoints', 'MCD Points') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-1.5 2xs:gap-2 sm:gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 sm:p-4 bg-neutral-800 rounded border border-neutral-700 min-w-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 mb-1.5 2xs:mb-2", children: [(0, jsx_runtime_1.jsx)(IconCreditCard, { className: "h-3 w-3 2xs:h-4 2xs:w-4 text-cyan-400 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[8px] 2xs:text-[10px] sm:text-xs text-neutral-400 tracking-wider truncate", children: t('currentBalance', 'Current Balance') })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-base 2xs:text-lg xs:text-xl sm:text-2xl font-bold text-cyan-400 font-mono truncate", children: mcdLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : mask(fmt(mcdAmount, 6)) }), (0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-500 mt-0.5 2xs:mt-1", children: "MCD" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 sm:p-4 bg-neutral-800 rounded border border-neutral-700 min-w-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 mb-1.5 2xs:mb-2", children: [(0, jsx_runtime_1.jsx)(IconTrendingUp, { className: "h-3 w-3 2xs:h-4 2xs:w-4 text-neutral-400 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[8px] 2xs:text-[10px] sm:text-xs text-neutral-400 tracking-wider truncate", children: t('totalReceived', 'Total Received') })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-base 2xs:text-lg xs:text-xl sm:text-2xl font-bold text-white font-mono truncate", children: mcdLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : mask(fmt(mcdTotalReceived, 6)) }), (0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-500 mt-0.5 2xs:mt-1", children: "MCD" })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-3 2xs:mt-4 pt-2 2xs:pt-3 border-t border-neutral-700 space-y-1.5 2xs:space-y-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-1.5 2xs:gap-2 text-[10px] 2xs:text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(IconGift, { className: "w-3 h-3 mt-0.5 shrink-0" }), (0, jsx_runtime_1.jsxs)("span", { children: [t('income', 'Income'), ": ", (0, jsx_runtime_1.jsx)("span", { className: "text-white", children: mask(fmt(mcdTotalReceived, 0)) }), ' · ', t('spent', 'Spent'), ": ", (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: mask(fmt(mcdSpent, 0)) }), ' · ', t('mcdDistributionNote', 'MCD is distributed daily to eligible miners.')] })] }) })] }) }), activeLocks.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 sm:p-4 md:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 text-neutral-400 text-xs 2xs:text-sm mb-1.5 2xs:mb-2 sm:mb-3 md:mb-4", children: [(0, jsx_runtime_1.jsx)(IconLock, { className: "w-3.5 h-3.5 2xs:w-4 2xs:h-4 sm:w-5 sm:h-5 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('lockPeriod14Days', 'Lock Period (14 days)') })] }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 gap-1.5 2xs:gap-2 sm:gap-3", children: activeLocks.map((lock) => ((0, jsx_runtime_1.jsx)(LockPeriodCard, { lock: lock, hideBalance: hideBalance }, lock.lock_id))) }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-2 2xs:mt-3 text-[10px] 2xs:text-xs text-neutral-500 font-mono", children: [t('totalLocked', 'Total locked'), ": ", mask(fmt(lockedAmount, 2)), " MCC"] })] }) })), walletList.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 sm:p-4 md:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 text-neutral-400 text-xs 2xs:text-sm mb-1.5 2xs:mb-2 sm:mb-3 md:mb-4", children: [(0, jsx_runtime_1.jsx)(IconWallet, { className: "w-3.5 h-3.5 2xs:w-4 2xs:h-4 sm:w-5 sm:h-5 text-cyan-400 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('connectedWallets', 'Connected Wallets') })] }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-1.5 2xs:space-y-2", children: walletList.map((w) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2 p-2 2xs:p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 sm:gap-3 min-w-0", children: [(0, jsx_runtime_1.jsxs)("code", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-300 font-mono truncate", children: [(0, jsx_runtime_1.jsxs)("span", { className: "2xs:hidden", children: [w.wallet_address.slice(0, 4), "...", w.wallet_address.slice(-4)] }), (0, jsx_runtime_1.jsxs)("span", { className: "hidden 2xs:inline xs:hidden", children: [w.wallet_address.slice(0, 6), "...", w.wallet_address.slice(-6)] }), (0, jsx_runtime_1.jsxs)("span", { className: "hidden xs:inline sm:hidden", children: [w.wallet_address.slice(0, 8), "...", w.wallet_address.slice(-8)] }), (0, jsx_runtime_1.jsx)("span", { className: "hidden sm:inline", children: w.wallet_address })] }), w.is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "text-[8px] 2xs:text-[10px] bg-cyan-400/20 text-cyan-400 border border-cyan-400/30 px-1 2xs:px-1.5 py-0.5 rounded font-mono shrink-0", children: "PRIMARY" }))] }), (0, jsx_runtime_1.jsx)("a", { href: `https://solscan.io/account/${w.wallet_address}`, target: "_blank", rel: "noopener noreferrer", className: "text-cyan-400 hover:text-cyan-300 transition-colors shrink-0", children: (0, jsx_runtime_1.jsx)(IconExternalLink, { className: "w-3.5 h-3.5 2xs:w-4 2xs:h-4" }) })] }, w.wallet_address))) })] }) }))] }));
|
|
211
|
+
: 'bg-neutral-800 text-neutral-400 hover:text-white hover:bg-neutral-700'}`, children: [(0, jsx_runtime_1.jsxs)("code", { className: "font-mono", children: [w.wallet_address.slice(0, 4), "...", w.wallet_address.slice(-4)] }), w.is_primary && (0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400 text-[9px] 2xs:text-[10px]", children: t('primary', 'Primary') })] }, w.wallet_address)))] })), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 text-neutral-400 text-xs 2xs:text-sm mb-1.5 2xs:mb-2 sm:mb-3 md:mb-4", children: [(0, jsx_runtime_1.jsx)(IconCreditCard, { className: "text-cyan-400 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('onChainAssets', 'On-Chain Assets') }), multiLoading && (0, jsx_runtime_1.jsx)(Spinner, { size: "w-3 h-3" })] }), multiLoading ? ((0, jsx_runtime_1.jsx)("div", { className: "py-10", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center gap-3", children: [(0, jsx_runtime_1.jsx)(Spinner, { size: "w-6 h-6" }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('syncingOnChainData', 'Syncing on-chain data...') }), (0, jsx_runtime_1.jsx)("div", { className: "w-48 h-1 bg-neutral-800 rounded-full overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "h-full bg-cyan-400/60 rounded-full animate-pulse", style: { width: '60%' } }) })] }) })) : ((0, jsx_runtime_1.jsx)(AssetList, { holdings: activeHoldings, hideBalance: hideBalance, showWalletColumn: showWalletCol, isLoading: multiLoading })), (0, jsx_runtime_1.jsx)("div", { className: "mt-3 2xs:mt-4 pt-2 2xs:pt-3 border-t border-neutral-700 space-y-1.5 2xs:space-y-2", children: isAllTab ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-1.5 2xs:gap-2 text-[10px] 2xs:text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(IconInfo, { className: "mt-0.5 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('allWalletsNote', 'Aggregated on-chain balances across {count} wallets. Low-value assets (<$1) are hidden.', { count: walletList.length }) })] })) : ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-1.5 2xs:space-y-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2 flex-wrap", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 text-[10px] 2xs:text-xs text-neutral-500 min-w-0", children: [(0, jsx_runtime_1.jsx)(IconInfo, { className: "shrink-0" }), (0, jsx_runtime_1.jsxs)("span", { className: "hidden 2xs:inline", children: [t('currentWallet', 'Current wallet'), ":"] }), (0, jsx_runtime_1.jsx)("code", { className: "text-neutral-400 bg-neutral-800 px-1.5 py-0.5 rounded font-mono truncate min-w-0 max-w-[140px] 2xs:max-w-[180px] sm:max-w-none", children: activeTab }), walletList.find((w) => w.wallet_address === activeTab)?.is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400 bg-cyan-400/20 px-1.5 py-0.5 rounded text-[9px] 2xs:text-[10px] shrink-0", children: t('primary', 'Primary') }))] }), (0, jsx_runtime_1.jsxs)("a", { href: `https://solscan.io/account/${activeTab}`, target: "_blank", rel: "noopener noreferrer", className: "text-cyan-400 hover:text-cyan-300 text-[10px] 2xs:text-xs flex items-center gap-1 whitespace-nowrap", children: [t('viewOnSolscan', 'View on Solscan'), " ", (0, jsx_runtime_1.jsx)(IconExternalLink, { className: "w-3 h-3" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-1.5 2xs:gap-2 text-[10px] 2xs:text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(IconInfo, { className: "mt-0.5 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('singleWalletNote', 'Showing on-chain balances for this wallet only. Low-value assets (<$1) are hidden.') })] })] })) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-3 2xs:p-4 sm:p-5 md:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-3 mb-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "p-2 2xs:p-3 bg-cyan-400/20 rounded-xl border border-cyan-400/30 shrink-0", children: (0, jsx_runtime_1.jsx)(IconWallet, { className: "w-5 h-5 2xs:w-6 2xs:h-6 sm:w-8 sm:h-8 text-cyan-400" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0 flex-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-400 tracking-wider mb-1", children: t('mccBalance', 'MCC Balance') }), (0, jsx_runtime_1.jsx)("div", { className: "text-xl 2xs:text-2xl xs:text-3xl sm:text-4xl md:text-5xl font-bold text-white font-mono truncate", children: mccLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : mask(fmt(mccBalance)) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-500 mt-1 truncate", children: [mccLoading ? '' : mask(`${fmtUSD(totalUsd)}`), !mccLoading && price > 0 && ((0, jsx_runtime_1.jsxs)("span", { className: "ml-2 text-[10px] 2xs:text-xs text-neutral-600", children: ["@ ", fmtUSD(price), "/MCC"] }))] })] })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => onNavigate?.(resolvePath('/mcc/mining')), className: "w-full flex items-center justify-center gap-2 px-4 py-2 sm:py-2.5 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-xs 2xs:text-sm transition-colors whitespace-nowrap", children: [(0, jsx_runtime_1.jsx)(IconExternalLink, { className: "h-4 w-4" }), t('mintRecords', 'Mining Records')] })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 sm:p-4 md:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 text-neutral-400 text-xs 2xs:text-sm mb-1.5 2xs:mb-2 sm:mb-3 md:mb-4", children: [(0, jsx_runtime_1.jsx)(IconGift, { className: "text-cyan-400 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('mcdPoints', 'MCD Points') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-1.5 2xs:gap-2 sm:gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 sm:p-4 bg-neutral-800 rounded border border-neutral-700 min-w-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 mb-1.5 2xs:mb-2", children: [(0, jsx_runtime_1.jsx)(IconCreditCard, { className: "h-3 w-3 2xs:h-4 2xs:w-4 text-cyan-400 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[8px] 2xs:text-[10px] sm:text-xs text-neutral-400 tracking-wider truncate", children: t('currentBalance', 'Current Balance') })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-base 2xs:text-lg xs:text-xl sm:text-2xl font-bold text-cyan-400 font-mono truncate", children: mcdLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : mask(fmt(mcdAmount, 6)) }), (0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-500 mt-0.5 2xs:mt-1", children: "MCD" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 sm:p-4 bg-neutral-800 rounded border border-neutral-700 min-w-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 mb-1.5 2xs:mb-2", children: [(0, jsx_runtime_1.jsx)(IconTrendingUp, { className: "h-3 w-3 2xs:h-4 2xs:w-4 text-neutral-400 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[8px] 2xs:text-[10px] sm:text-xs text-neutral-400 tracking-wider truncate", children: t('totalReceived', 'Total Received') })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-base 2xs:text-lg xs:text-xl sm:text-2xl font-bold text-white font-mono truncate", children: mcdLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : mask(fmt(mcdTotalReceived, 6)) }), (0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-neutral-500 mt-0.5 2xs:mt-1", children: "MCD" })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-3 2xs:mt-4 pt-2 2xs:pt-3 border-t border-neutral-700 space-y-1.5 2xs:space-y-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-1.5 2xs:gap-2 text-[10px] 2xs:text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(IconGift, { className: "w-3 h-3 mt-0.5 shrink-0" }), (0, jsx_runtime_1.jsxs)("span", { children: [t('spent', 'Spent'), ": ", (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: mask(fmt(mcdSpent, 0)) }), ' · ', t('mcdDistributionNote', 'MCD is distributed daily to eligible miners.')] })] }) })] }) }), activeLocks.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 sm:p-4 md:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 text-neutral-400 text-xs 2xs:text-sm mb-1.5 2xs:mb-2 sm:mb-3 md:mb-4", children: [(0, jsx_runtime_1.jsx)(IconLock, { className: "w-3.5 h-3.5 2xs:w-4 2xs:h-4 sm:w-5 sm:h-5 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('lockPeriod14Days', 'Lock Period (14 days)') })] }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 gap-1.5 2xs:gap-2 sm:gap-3", children: activeLocks.map((lock) => ((0, jsx_runtime_1.jsx)(LockPeriodCard, { lock: lock, hideBalance: hideBalance }, lock.lock_id))) }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-2 2xs:mt-3 text-[10px] 2xs:text-xs text-neutral-500 font-mono", children: [t('totalLocked', 'Total locked'), ": ", mask(fmt(lockedAmount, 2)), " MCC"] })] }) }))] }));
|
|
212
212
|
}
|