@microcosmmoney/portal-react 3.12.6 → 3.12.7
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.
|
@@ -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
|
}
|