@microcosmmoney/portal-react 3.11.0 → 3.12.0
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.
- package/dist/components/dashboard/assets-summary.d.ts +1 -1
- package/dist/components/dashboard/assets-summary.js +21 -18
- package/dist/components/dashboard/dashboard-overview.js +1 -1
- package/dist/components/dashboard/lock-periods.d.ts +1 -1
- package/dist/components/dashboard/lock-periods.js +4 -4
- package/dist/components/dashboard/market-overview-bar.js +110 -26
- package/dist/components/dashboard/mcc-token-stats.d.ts +1 -1
- package/dist/components/dashboard/mcc-token-stats.js +32 -18
- package/dist/components/dashboard/mcd-stats.d.ts +1 -1
- package/dist/components/dashboard/mcd-stats.js +32 -18
- package/dist/components/dashboard/mining-weight.js +11 -15
- package/dist/components/dashboard/minting-stats.js +10 -11
- package/dist/components/dashboard/my-mining.d.ts +2 -1
- package/dist/components/dashboard/my-mining.js +22 -14
- package/dist/components/dashboard/price-chart.js +44 -7
- package/dist/components/dashboard/quick-actions.js +35 -21
- package/package.json +1 -1
|
@@ -3,4 +3,4 @@ export interface MicrocosmAssetsSummaryProps {
|
|
|
3
3
|
onNavigate?: (path: string) => void;
|
|
4
4
|
accentColor?: string;
|
|
5
5
|
}
|
|
6
|
-
export declare function MicrocosmAssetsSummary({ basePath,
|
|
6
|
+
export declare function MicrocosmAssetsSummary({ basePath, accentColor }: MicrocosmAssetsSummaryProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,41 +5,44 @@ exports.MicrocosmAssetsSummary = MicrocosmAssetsSummary;
|
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const auth_react_1 = require("@microcosmmoney/auth-react");
|
|
7
7
|
const i18n_context_1 = require("../../i18n-context");
|
|
8
|
+
const link_context_1 = require("../../link-context");
|
|
8
9
|
const RANK_COLOR = {
|
|
9
10
|
miner: 'text-cyan-300',
|
|
10
11
|
commander: 'text-white', pioneer: 'text-cyan-400', warden: 'text-cyan-300', admiral: 'text-cyan-300',
|
|
11
12
|
};
|
|
12
|
-
function MicrocosmAssetsSummary({ basePath = '',
|
|
13
|
+
function MicrocosmAssetsSummary({ basePath = '', accentColor }) {
|
|
13
14
|
const t = (0, i18n_context_1.useTranslations)('mccDashboard');
|
|
15
|
+
const Link = (0, link_context_1.useLinkComponent)();
|
|
14
16
|
const { balance: mccData, loading: mccLoading } = (0, auth_react_1.useMCC)(120000);
|
|
15
|
-
const { balance: mcdData
|
|
17
|
+
const { balance: mcdData } = (0, auth_react_1.useMCD)(120000);
|
|
16
18
|
const { data: levelData } = (0, auth_react_1.useLevelProgress)();
|
|
17
19
|
const { data: wallets } = (0, auth_react_1.useWallets)();
|
|
18
20
|
const { data: locks } = (0, auth_react_1.useMCCLocks)();
|
|
19
21
|
const { data: marketData } = (0, auth_react_1.useMarketData)();
|
|
20
22
|
const resolvePath = (p) => basePath ? `${basePath.replace(/\/$/, '')}${p}` : p;
|
|
21
|
-
const
|
|
22
|
-
const mccPrice = marketData?.price_usd ?? 0;
|
|
23
|
-
const mccUsdValue = mccPrice > 0 ?
|
|
23
|
+
const mccDisplay = mccData?.balance ?? 0;
|
|
24
|
+
const mccPrice = marketData?.price ?? marketData?.price_usd ?? 0;
|
|
25
|
+
const mccUsdValue = mccPrice > 0 ? mccDisplay * mccPrice : 0;
|
|
24
26
|
const mcdAmount = parseFloat(mcdData?.available_balance ?? '0');
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
+
const mcdTotalReceived = parseFloat(mcdData?.total_balance ?? '0');
|
|
28
|
+
const mcdTotalSpent = parseFloat(mcdData?.frozen_balance ?? '0');
|
|
27
29
|
const walletCount = Array.isArray(wallets) ? wallets.length : 0;
|
|
28
30
|
const activeLocks = Array.isArray(locks) ? locks.filter((l) => l.status === 'locked') : [];
|
|
29
31
|
const lockedAmount = activeLocks.reduce((sum, l) => sum + (l.amount || 0), 0);
|
|
30
|
-
const
|
|
32
|
+
const userRank = levelData?.level ?? levelData?.current_level ?? null;
|
|
31
33
|
const nextRank = levelData?.next_level ?? null;
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
const progressPercent = levelData?.progress_percent ?? 0;
|
|
35
|
+
const nextLevelRequirement = levelData?.next_level_requirement ?? null;
|
|
36
|
+
const getRankColor = (rank) => {
|
|
37
|
+
if (!rank)
|
|
38
|
+
return 'text-neutral-500';
|
|
39
|
+
return RANK_COLOR[rank.toLowerCase()] || 'text-neutral-400';
|
|
40
|
+
};
|
|
41
|
+
const rankColor = accentColor ? undefined : getRankColor(userRank);
|
|
37
42
|
const rankStyle = accentColor ? { color: accentColor } : undefined;
|
|
38
43
|
const spinnerBorderColor = accentColor ? { borderColor: accentColor, borderTopColor: 'transparent' } : undefined;
|
|
39
44
|
const spinnerClass = accentColor ? 'inline-block w-5 h-5 border-2 rounded-full animate-spin' : 'inline-block w-5 h-5 border-2 border-cyan-400 border-t-transparent rounded-full animate-spin';
|
|
40
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
? (0, jsx_runtime_1.jsx)("span", { className: spinnerClass, style: spinnerBorderColor })
|
|
44
|
-
: fmt(mcdAmount) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[10px] text-neutral-500 font-mono mt-1", children: [t('in', 'in'), ": ", fmt(mcdReceived, 0), " ", t('out', 'out'), ": ", fmt(mcdSpent, 0)] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl p-4 blockchain-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 mb-2", children: [(0, jsx_runtime_1.jsx)("svg", { className: "blockchain-icon w-3.5 h-3.5 text-[#5EEAD4]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-[10px] font-mono tracking-widest uppercase", children: t('locked', 'LOCKED') })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold font-mono text-white", children: fmt(lockedAmount, 0) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[10px] text-neutral-500 font-mono mt-1", children: [activeLocks.length, " ", t('lockPeriods', 'lock period(s)')] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl p-4 blockchain-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 mb-2", children: [(0, jsx_runtime_1.jsx)("svg", { className: "blockchain-icon w-3.5 h-3.5 text-[#5EEAD4]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" }) }), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-[10px] font-mono tracking-widest uppercase", children: t('wallets', 'WALLETS') })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold font-mono text-white", children: walletCount })] }), (0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl p-4 blockchain-card", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[#5EEAD4] text-[10px] font-mono tracking-widest uppercase mb-2", children: t('rank', 'RANK') }), (0, jsx_runtime_1.jsx)("div", { className: `text-lg font-bold font-mono ${rankColor ?? ''}`, style: rankStyle, children: rank || t('na', 'N/A') }), nextRank && ((0, jsx_runtime_1.jsxs)("div", { className: "mt-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-full bg-neutral-800 rounded-full h-1.5", children: (0, jsx_runtime_1.jsx)("div", { className: accentColor ? 'h-1.5 rounded-full transition-all' : 'bg-cyan-400 h-1.5 rounded-full transition-all', style: { width: `${Math.min(progress, 100)}%`, ...(accentColor ? { backgroundColor: accentColor } : {}) } }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[10px] text-neutral-500 font-mono mt-1", children: [progress.toFixed(0), "% \u2192 ", nextRank] })] }))] })] }));
|
|
45
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 gap-2 sm:gap-3", children: [(0, jsx_runtime_1.jsx)(Link, { href: resolvePath('/mcc/wallet'), className: "block group", children: (0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl p-2.5 sm:p-4 blockchain-card h-full", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 mb-2", children: [(0, jsx_runtime_1.jsxs)("svg", { className: "w-3.5 h-3.5 text-[#5EEAD4]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [(0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }), (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" })] }), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-[10px] font-mono tracking-widest uppercase", children: t('mccBalance', 'MCC_BALANCE') })] }), (0, jsx_runtime_1.jsx)("div", { className: accentColor ? 'text-base sm:text-2xl font-bold font-mono' : 'text-base sm:text-2xl font-bold font-mono text-cyan-400', style: accentColor ? { color: accentColor } : undefined, children: mccLoading
|
|
46
|
+
? (0, jsx_runtime_1.jsx)("span", { className: spinnerClass, style: spinnerBorderColor })
|
|
47
|
+
: mccDisplay.toLocaleString('en-US', { minimumFractionDigits: 3, maximumFractionDigits: 3 }) }), mccUsdValue > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-500 font-mono mt-1", children: ["\u2248 $", mccUsdValue.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })] }))] }) }), (0, jsx_runtime_1.jsx)(Link, { href: resolvePath('/mcc/mcd'), className: "block group", children: (0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl p-2.5 sm:p-4 blockchain-card h-full", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 mb-2", children: [(0, jsx_runtime_1.jsx)("svg", { className: "w-3.5 h-3.5 text-[#5EEAD4]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" }) }), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-[10px] font-mono tracking-widest uppercase", children: t('mcdBalance', 'MCD_BALANCE') })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-base sm:text-2xl font-bold font-mono text-white", children: mcdAmount.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[10px] text-neutral-500 font-mono mt-1", children: [t('in', 'in'), ": ", mcdTotalReceived.toLocaleString('en-US', { maximumFractionDigits: 0 }), " ", t('out', 'out'), ": ", mcdTotalSpent.toLocaleString('en-US', { maximumFractionDigits: 0 })] })] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl p-2.5 sm:p-4 blockchain-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 mb-2", children: [(0, jsx_runtime_1.jsx)("svg", { className: "w-3.5 h-3.5 text-[#5EEAD4]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-[10px] font-mono tracking-widest uppercase", children: t('locked', 'LOCKED') })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-base sm:text-2xl font-bold font-mono text-white", children: lockedAmount.toLocaleString('en-US', { maximumFractionDigits: 0 }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[10px] text-neutral-500 font-mono mt-1", children: [activeLocks.length, " ", t('lockPeriods', 'lock period'), activeLocks.length !== 1 ? 's' : ''] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl p-2.5 sm:p-4 blockchain-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 mb-2", children: [(0, jsx_runtime_1.jsx)("svg", { className: "w-3.5 h-3.5 text-[#5EEAD4]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" }) }), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-[10px] font-mono tracking-widest uppercase", children: t('wallets', 'WALLETS') })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-base sm:text-2xl font-bold font-mono text-white", children: walletCount })] }), (0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl p-2.5 sm:p-4 blockchain-card", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[#5EEAD4] text-[10px] font-mono tracking-widest uppercase mb-2", children: t('rank', 'RANK') }), (0, jsx_runtime_1.jsx)("div", { className: `text-lg font-bold font-mono ${rankColor ?? ''}`, style: rankStyle, children: userRank || t('na', 'N/A') }), nextRank && ((0, jsx_runtime_1.jsxs)("div", { className: "mt-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-full bg-neutral-800 rounded-full h-1.5", children: (0, jsx_runtime_1.jsx)("div", { className: accentColor ? 'h-1.5 rounded-full transition-all' : 'bg-cyan-400 h-1.5 rounded-full transition-all', style: { width: `${Math.min(progressPercent, 100)}%`, ...(accentColor ? { backgroundColor: accentColor } : {}) } }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[10px] text-neutral-500 font-mono mt-1", children: [nextLevelRequirement ? `${nextLevelRequirement.have}/${nextLevelRequirement.need} ${nextLevelRequirement.tier}` : `${progressPercent.toFixed(0)}%`, " \u2192 ", nextRank] })] }))] })] }));
|
|
45
48
|
}
|
|
@@ -61,5 +61,5 @@ function MicrocosmDashboardOverview({ basePath = '', onNavigate, showHeader = tr
|
|
|
61
61
|
const rootStyle = accentColor
|
|
62
62
|
? { '--mc-accent': accentColor, '--mc-accent-rgb': hexToRgb(accentColor) }
|
|
63
63
|
: undefined;
|
|
64
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto font-mono
|
|
64
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto font-mono px-3 py-4 space-y-3 xs:px-4 xs:space-y-4 sm:px-6 sm:py-6 sm:space-y-6", style: rootStyle, children: [showHeader && ((0, jsx_runtime_1.jsx)("div", { className: "text-center", children: (0, jsx_runtime_1.jsx)("h1", { className: accentColor ? 'text-lg 2xs:text-xl xs:text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-bold tracking-tight' : 'text-lg 2xs:text-xl xs:text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-bold tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-cyan-400 to-cyan-200', style: accentColor ? { backgroundImage: `linear-gradient(to right, ${accentColor}, ${accentColor}cc)`, WebkitBackgroundClip: 'text', backgroundClip: 'text', color: 'transparent' } : undefined, children: resolvedHeader }) })), (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(market_overview_bar_1.MicrocosmMarketBar, { accentColor: accentColor }) }), (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(quick_actions_1.MicrocosmQuickActions, { basePath: basePath, onNavigate: onNavigate, accentColor: accentColor }) }), (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(assets_summary_1.MicrocosmAssetsSummary, { basePath: basePath, onNavigate: onNavigate, accentColor: accentColor }) }), (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(price_chart_1.MicrocosmPriceChart, { accentColor: accentColor }) }), (0, jsx_runtime_1.jsx)(LazySection, { fallback: (0, jsx_runtime_1.jsxs)("div", { className: "grid lg:grid-cols-2 gap-3 sm:gap-6", children: [(0, jsx_runtime_1.jsx)(CardSkeleton, { height: "h-56" }), (0, jsx_runtime_1.jsx)(CardSkeleton, { height: "h-56" })] }), children: (0, jsx_runtime_1.jsxs)("div", { className: "grid lg:grid-cols-2 gap-3 sm:gap-6", children: [(0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(my_mining_1.MicrocosmMyMining, { detailsPath: `${basePath}/mcc/mining`, onNavigate: onNavigate, accentColor: accentColor }) }), (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(mining_weight_1.MicrocosmMiningWeight, { accentColor: accentColor }) })] }) }), (0, jsx_runtime_1.jsx)(LazySection, { fallback: (0, jsx_runtime_1.jsxs)("div", { className: "grid lg:grid-cols-2 gap-3 sm:gap-6", children: [(0, jsx_runtime_1.jsx)(CardSkeleton, { height: "h-56" }), (0, jsx_runtime_1.jsx)(CardSkeleton, { height: "h-56" })] }), children: (0, jsx_runtime_1.jsxs)("div", { className: "grid lg:grid-cols-2 gap-3 sm:gap-6", children: [(0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(minting_stats_1.MicrocosmMintingStats, { accentColor: accentColor }) }), (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(ecosystem_stats_1.MicrocosmEcosystemStats, { accentColor: accentColor }) })] }) }), (0, jsx_runtime_1.jsx)(LazySection, { fallback: (0, jsx_runtime_1.jsxs)("div", { className: "grid lg:grid-cols-2 gap-3 sm:gap-6", children: [(0, jsx_runtime_1.jsx)(CardSkeleton, {}), (0, jsx_runtime_1.jsx)(CardSkeleton, {})] }), children: (0, jsx_runtime_1.jsxs)("div", { className: "grid lg:grid-cols-2 gap-3 sm:gap-6", children: [(0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(mcc_token_stats_1.MicrocosmMCCTokenStats, { accentColor: accentColor }) }), (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(mcd_stats_1.MicrocosmMCDStats, { accentColor: accentColor }) })] }) }), (0, jsx_runtime_1.jsx)(LazySection, { fallback: (0, jsx_runtime_1.jsx)(CardSkeleton, {}), children: (0, jsx_runtime_1.jsx)(SafeRender, { children: (0, jsx_runtime_1.jsx)(lock_periods_1.MicrocosmLockPeriods, { accentColor: accentColor }) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center py-4 space-y-1", children: [(0, jsx_runtime_1.jsx)("div", { className: accentColor ? 'text-xs font-mono' : 'text-xs text-cyan-400/60 font-mono', style: accentColor ? { color: `rgba(${hexToRgb(accentColor)},0.6)` } : undefined, children: "Data refreshes every 4 hours \u00B7 For real-time data, please check on-chain directly" }), (0, jsx_runtime_1.jsx)("div", { className: accentColor ? 'text-xs font-mono' : 'text-xs text-cyan-400/60 font-mono', style: accentColor ? { color: `rgba(${hexToRgb(accentColor)},0.6)` } : undefined, children: "\u6570\u636E\u6BCF 4 \u5C0F\u65F6\u66F4\u65B0 \u00B7 \u5373\u65F6\u6570\u636E\u8BF7\u76F4\u63A5\u67E5\u8BE2\u94FE\u4E0A" }), (0, jsx_runtime_1.jsx)("div", { className: accentColor ? 'text-xs font-mono' : 'text-xs text-cyan-400/60 font-mono', style: accentColor ? { color: `rgba(${hexToRgb(accentColor)},0.6)` } : undefined, children: "\u30C7\u30FC\u30BF\u306F4\u6642\u9593\u3054\u3068\u306B\u66F4\u65B0 \u00B7 \u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u30C7\u30FC\u30BF\u306F\u30AA\u30F3\u30C1\u30A7\u30FC\u30F3\u3067\u78BA\u8A8D" }), (0, jsx_runtime_1.jsx)("div", { className: accentColor ? 'text-xs font-mono' : 'text-xs text-cyan-400/60 font-mono', style: accentColor ? { color: `rgba(${hexToRgb(accentColor)},0.6)` } : undefined, children: "\uB370\uC774\uD130\uB294 4\uC2DC\uAC04\uB9C8\uB2E4 \uAC31\uC2E0 \u00B7 \uC2E4\uC2DC\uAC04 \uB370\uC774\uD130\uB294 \uC628\uCCB4\uC778\uC5D0\uC11C \uD655\uC778" })] })] }));
|
|
65
65
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export interface MicrocosmLockPeriodsProps {
|
|
2
2
|
accentColor?: string;
|
|
3
3
|
}
|
|
4
|
-
export declare function MicrocosmLockPeriods(
|
|
4
|
+
export declare function MicrocosmLockPeriods(_props?: MicrocosmLockPeriodsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -18,13 +18,13 @@ function daysRemaining(endTime) {
|
|
|
18
18
|
const days = Math.ceil(diff / (1000 * 60 * 60 * 24));
|
|
19
19
|
return `${days}d`;
|
|
20
20
|
}
|
|
21
|
-
function MicrocosmLockPeriods(
|
|
21
|
+
function MicrocosmLockPeriods(_props = {}) {
|
|
22
22
|
const t = (0, i18n_context_1.useTranslations)('mccDashboard');
|
|
23
23
|
const { data } = (0, auth_react_1.useMCCLocks)();
|
|
24
24
|
const raw = data;
|
|
25
|
-
const
|
|
26
|
-
const activeLocks =
|
|
25
|
+
const lockPeriods = Array.isArray(raw) ? raw : raw?.locks ?? [];
|
|
26
|
+
const activeLocks = lockPeriods.filter((p) => p.status === 'locked');
|
|
27
27
|
if (activeLocks.length === 0)
|
|
28
28
|
return null;
|
|
29
|
-
return ((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.jsx)("div", { className: "p-6", children: (0, jsx_runtime_1.jsx)("div", { className: "space-y-3", children: activeLocks.map((lock) => ((0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-4 blockchain-sub-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-start mb-2", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[#5EEAD4] text-xs font-mono tracking-widest uppercase", children: lock.reason }), (0, jsx_runtime_1.jsxs)("div", { className:
|
|
29
|
+
return ((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.jsx)("div", { className: "p-3 sm:p-6", children: (0, jsx_runtime_1.jsx)("div", { className: "space-y-2 sm:space-y-3", children: activeLocks.map((lock) => ((0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2.5 sm:p-4 blockchain-sub-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-start mb-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0 flex-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[#5EEAD4] text-[10px] sm:text-xs font-mono tracking-widest uppercase truncate", children: lock.reason }), (0, jsx_runtime_1.jsxs)("div", { className: "text-base sm:text-xl font-bold font-mono text-cyan-400 mt-1", children: [(lock.amount ?? 0).toLocaleString(), " MCC"] })] }), (0, jsx_runtime_1.jsx)("span", { className: "px-2 py-0.5 bg-cyan-400/20 text-cyan-400 text-xs font-mono rounded", children: t('lockedStatus', 'LOCKED') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-500 space-y-1 font-mono", children: [(0, jsx_runtime_1.jsxs)("div", { children: [t('unlockAt', 'unlock_at'), ": ", formatDateTime(lock.lock_end)] }), (0, jsx_runtime_1.jsxs)("div", { children: [t('remaining', 'remaining'), ":", ' ', (0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400", children: daysRemaining(lock.lock_end) })] })] })] }, lock.lock_id))) }) }) }));
|
|
30
30
|
}
|
|
@@ -4,41 +4,125 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.MicrocosmMarketBar = MicrocosmMarketBar;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const auth_react_1 = require("@microcosmmoney/auth-react");
|
|
7
|
-
const i18n_context_1 = require("../../i18n-context");
|
|
8
|
-
function formatCompact(value) {
|
|
9
|
-
if (value >= 1000000)
|
|
10
|
-
return `${(value / 1000000).toFixed(2)}M`;
|
|
11
|
-
if (value >= 1000)
|
|
12
|
-
return `${(value / 1000).toFixed(1)}K`;
|
|
13
|
-
return value.toFixed(2);
|
|
14
|
-
}
|
|
15
7
|
function MicrocosmMarketBar({ accentColor } = {}) {
|
|
16
|
-
const t = (0, i18n_context_1.useTranslations)('mccDashboard');
|
|
17
8
|
const { data, loading } = (0, auth_react_1.useMarketData)();
|
|
18
|
-
const
|
|
9
|
+
const { data: mccPriceData } = (0, auth_react_1.useMCCPrice)();
|
|
10
|
+
const { data: ecosystemOps } = (0, auth_react_1.useEcosystemOperations)();
|
|
19
11
|
if (loading || !data) {
|
|
20
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-3 mb-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 xs:grid-cols-3 lg:grid-cols-6 gap-2 sm:gap-3", children: Array.from({ length: 6 }).map((_, i) => ((0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl blockchain-card p-2.5 sm:p-4 animate-pulse", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-3 bg-neutral-800 rounded w-16 mb-2" }), (0, jsx_runtime_1.jsx)("div", { className: "h-5 sm:h-6 bg-neutral-800 rounded w-20 sm:w-24" })] }, i))) }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 xs:grid-cols-3 lg:grid-cols-6 gap-2 sm:gap-3", children: Array.from({ length: 6 }).map((_, i) => ((0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl blockchain-card p-2.5 sm:p-4 animate-pulse", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-3 bg-neutral-800 rounded w-16 mb-2" }), (0, jsx_runtime_1.jsx)("div", { className: "h-5 sm:h-6 bg-neutral-800 rounded w-20 sm:w-24" })] }, i))) })] }));
|
|
21
13
|
}
|
|
14
|
+
const displayPrice = mccPriceData?.price ?? data.price_usd ?? 0;
|
|
22
15
|
const priceChange24h = data.price_change_24h ?? 0;
|
|
23
16
|
const isPositive = priceChange24h >= 0;
|
|
17
|
+
const basePrice = mccPriceData?.base_price ?? mccPriceData?.price_usd ?? 0;
|
|
18
|
+
const miningPrice = basePrice > 0 ? basePrice * 4 : 0;
|
|
19
|
+
const epoch = ecosystemOps?.epoch;
|
|
20
|
+
const buyback = ecosystemOps?.buyback;
|
|
21
|
+
const epochYield = epoch?.epoch_yield ?? 0;
|
|
22
|
+
const epochMinted = epoch?.epoch_minted ?? 0;
|
|
23
|
+
const epochRemaining = epochYield > epochMinted ? epochYield - epochMinted : 0;
|
|
24
|
+
const miningVault = epoch?.mining_vault_mcc ?? 0;
|
|
25
|
+
const buybackPoolUsd = buyback?.pool_usd_balance ?? null;
|
|
24
26
|
const buys = data.buys_24h ?? 0;
|
|
25
27
|
const sells = data.sells_24h ?? 0;
|
|
26
|
-
const
|
|
27
|
-
const stats = [
|
|
28
|
+
const marketStats = [
|
|
28
29
|
{
|
|
29
|
-
label:
|
|
30
|
-
value: `$${
|
|
30
|
+
label: 'MCC_PRICE',
|
|
31
|
+
value: `$${displayPrice.toFixed(4)}`,
|
|
31
32
|
sub: `${isPositive ? '~+' : '~'}${priceChange24h.toFixed(2)}%`,
|
|
32
|
-
subColor: isPositive ?
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
subColor: isPositive ? 'text-cyan-400' : 'text-red-400',
|
|
34
|
+
color: 'text-cyan-400',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: 'MINING_PRICE',
|
|
38
|
+
value: miningPrice > 0 ? `$${miningPrice.toFixed(4)}` : '--',
|
|
39
|
+
sub: basePrice > 0 ? `base: $${basePrice.toFixed(4)}` : '',
|
|
40
|
+
subColor: 'text-neutral-500',
|
|
41
|
+
color: 'text-cyan-300',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: '24H_VOLUME',
|
|
45
|
+
value: `$${formatCompact(data.volume_24h ?? 0)}`,
|
|
46
|
+
color: 'text-white',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: 'LIQUIDITY',
|
|
50
|
+
value: (data.liquidity_usd ?? 0) > 0 ? `$${formatCompact(data.liquidity_usd)}` : '-',
|
|
51
|
+
color: 'text-white',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: 'FDV',
|
|
55
|
+
value: (data.fdv ?? 0) > 0 ? `$${formatCompact(data.fdv)}` : '-',
|
|
56
|
+
color: 'text-white',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: 'BUY/SELL',
|
|
60
|
+
value: `${buys}/${sells}`,
|
|
61
|
+
sub: `${buys + sells} trades`,
|
|
62
|
+
subColor: 'text-neutral-500',
|
|
63
|
+
color: 'text-white',
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
const protocolStats = [
|
|
67
|
+
{
|
|
68
|
+
label: 'EPOCH',
|
|
69
|
+
value: epoch ? `#${epoch.current_epoch}` : '--',
|
|
70
|
+
sub: '2140 Protocol',
|
|
71
|
+
subColor: 'text-neutral-500',
|
|
72
|
+
color: 'text-cyan-400',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
label: 'EPOCH_YIELD',
|
|
76
|
+
value: epochYield > 0 ? formatMCC(epochYield) : '--',
|
|
77
|
+
sub: 'MCC / epoch',
|
|
78
|
+
subColor: 'text-neutral-500',
|
|
79
|
+
color: 'text-white',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
label: 'EPOCH_MINTED',
|
|
83
|
+
value: epochMinted > 0 ? formatMCC(epochMinted) : '0',
|
|
84
|
+
sub: epochYield > 0 ? `${((epochMinted / epochYield) * 100).toFixed(1)}% used` : '',
|
|
85
|
+
subColor: 'text-neutral-500',
|
|
86
|
+
color: 'text-cyan-300',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
label: 'REMAINING',
|
|
90
|
+
value: formatMCC(epochRemaining),
|
|
91
|
+
sub: 'this epoch',
|
|
92
|
+
subColor: 'text-neutral-500',
|
|
93
|
+
color: 'text-white',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
label: 'MINING_VAULT',
|
|
97
|
+
value: miningVault > 0 ? formatCompact(miningVault) : '--',
|
|
98
|
+
sub: 'MCC reserve',
|
|
99
|
+
subColor: 'text-neutral-500',
|
|
100
|
+
color: 'text-white',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
label: 'POOL_BALANCE',
|
|
104
|
+
value: buybackPoolUsd != null ? `$${formatCompact(buybackPoolUsd)}` : '--',
|
|
105
|
+
sub: 'USDC+USDT',
|
|
106
|
+
subColor: 'text-neutral-500',
|
|
107
|
+
color: 'text-white',
|
|
108
|
+
},
|
|
42
109
|
];
|
|
43
|
-
return ((0, jsx_runtime_1.
|
|
110
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-2 sm:space-y-3 mb-4 sm:mb-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 xs:grid-cols-3 lg:grid-cols-6 gap-2 sm:gap-3", children: marketStats.map((stat) => ((0, jsx_runtime_1.jsx)(StatCard, { ...stat }, stat.label))) }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 xs:grid-cols-3 lg:grid-cols-6 gap-2 sm:gap-3", children: protocolStats.map((stat) => ((0, jsx_runtime_1.jsx)(StatCard, { ...stat }, stat.label))) })] }));
|
|
111
|
+
}
|
|
112
|
+
function StatCard({ label, value, sub, subColor, color }) {
|
|
113
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl blockchain-card p-2.5 sm:p-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[#5EEAD4] text-[9px] sm:text-[10px] font-mono mb-0.5 sm:mb-1 tracking-widest uppercase", children: label }), (0, jsx_runtime_1.jsx)("div", { className: `text-sm xs:text-base sm:text-xl font-bold font-mono truncate ${color}`, children: value }), sub && ((0, jsx_runtime_1.jsx)("div", { className: `text-[10px] sm:text-xs font-mono mt-0.5 truncate ${subColor || 'text-neutral-500'}`, children: sub }))] }));
|
|
114
|
+
}
|
|
115
|
+
function formatCompact(value) {
|
|
116
|
+
if (value >= 1000000)
|
|
117
|
+
return `${(value / 1000000).toFixed(2)}M`;
|
|
118
|
+
if (value >= 1000)
|
|
119
|
+
return `${(value / 1000).toFixed(1)}K`;
|
|
120
|
+
return value.toFixed(2);
|
|
121
|
+
}
|
|
122
|
+
function formatMCC(value) {
|
|
123
|
+
if (value >= 1000000)
|
|
124
|
+
return `${(value / 1000000).toFixed(2)}M`;
|
|
125
|
+
if (value >= 1000)
|
|
126
|
+
return `${(value / 1000).toFixed(2)}K`;
|
|
127
|
+
return value.toFixed(2);
|
|
44
128
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export interface MicrocosmMCCTokenStatsProps {
|
|
2
2
|
accentColor?: string;
|
|
3
3
|
}
|
|
4
|
-
export declare function MicrocosmMCCTokenStats(
|
|
4
|
+
export declare function MicrocosmMCCTokenStats(_props?: MicrocosmMCCTokenStatsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,26 +5,40 @@ exports.MicrocosmMCCTokenStats = MicrocosmMCCTokenStats;
|
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const auth_react_1 = require("@microcosmmoney/auth-react");
|
|
7
7
|
const i18n_context_1 = require("../../i18n-context");
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
function MicrocosmMCCTokenStats(
|
|
8
|
+
const IconUsers = () => ((0, jsx_runtime_1.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "#5EEAD4", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }), (0, jsx_runtime_1.jsx)("circle", { cx: "9", cy: "7", r: "4" }), (0, jsx_runtime_1.jsx)("path", { d: "M22 21v-2a4 4 0 0 0-3-3.87" }), (0, jsx_runtime_1.jsx)("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })] }));
|
|
9
|
+
const IconCoins = () => ((0, jsx_runtime_1.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "#5EEAD4", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "8", cy: "8", r: "6" }), (0, jsx_runtime_1.jsx)("path", { d: "M18.09 10.37A6 6 0 1 1 10.34 18" }), (0, jsx_runtime_1.jsx)("path", { d: "M7 6h1v4" })] }));
|
|
10
|
+
const IconPickaxe = () => ((0, jsx_runtime_1.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "#5EEAD4", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M14.531 12.469 6.619 20.38a1 1 0 1 1-3-3l7.912-7.912" }), (0, jsx_runtime_1.jsx)("path", { d: "M15.686 4.314A12.5 12.5 0 0 0 5.461 2.958l-.834 2.22a5.25 5.25 0 0 0 4.626 7.065l.172-.003a5.25 5.25 0 0 0 5.022-3.89l.39-1.507a12.5 12.5 0 0 0 .849-2.53Z" })] }));
|
|
11
|
+
const IconTrendingUp = () => ((0, jsx_runtime_1.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "#5EEAD4", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("polyline", { points: "22 7 13.5 15.5 8.5 10.5 2 17" }), (0, jsx_runtime_1.jsx)("polyline", { points: "16 7 22 7 22 13" })] }));
|
|
12
|
+
const IconCoinHeader = () => ((0, jsx_runtime_1.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#5EEAD4", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "8", cy: "8", r: "6" }), (0, jsx_runtime_1.jsx)("path", { d: "M18.09 10.37A6 6 0 1 1 10.34 18" }), (0, jsx_runtime_1.jsx)("path", { d: "M7 6h1v4" })] }));
|
|
13
|
+
const IconSpinner = () => ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "#5EEAD4", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "animate-spin", children: (0, jsx_runtime_1.jsx)("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }));
|
|
14
|
+
function MicrocosmMCCTokenStats(_props = {}) {
|
|
15
15
|
const t = (0, i18n_context_1.useTranslations)('mccDashboard');
|
|
16
16
|
const { data, loading } = (0, auth_react_1.useMCCStats)();
|
|
17
|
-
const ac = accentColor || '#22d3ee';
|
|
18
17
|
const stats = [
|
|
19
|
-
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
{
|
|
19
|
+
label: t('holders', 'holders'),
|
|
20
|
+
value: data?.holders_count,
|
|
21
|
+
format: (v) => v.toLocaleString(),
|
|
22
|
+
icon: (0, jsx_runtime_1.jsx)(IconUsers, {}),
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: t('circulating', 'circulating'),
|
|
26
|
+
value: data?.circulating_supply,
|
|
27
|
+
format: (v) => `${(v / 1e6).toFixed(2)}M`,
|
|
28
|
+
icon: (0, jsx_runtime_1.jsx)(IconCoins, {}),
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: t('totalMiningTx', 'total_mining_tx'),
|
|
32
|
+
value: data?.total_mining_count,
|
|
33
|
+
format: (v) => v.toLocaleString(),
|
|
34
|
+
icon: (0, jsx_runtime_1.jsx)(IconPickaxe, {}),
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: t('totalMiningUsdc', 'total_mining_usdc'),
|
|
38
|
+
value: data?.total_mining_usdc,
|
|
39
|
+
format: (v) => `$${(v / 1e6).toFixed(2)}`,
|
|
40
|
+
icon: (0, jsx_runtime_1.jsx)(IconTrendingUp, {}),
|
|
41
|
+
},
|
|
23
42
|
];
|
|
24
|
-
|
|
25
|
-
const spinnerClass = accentColor ? 'inline-block w-5 h-5 border-2 rounded-full animate-spin' : 'inline-block w-5 h-5 border-2 border-cyan-400 border-t-transparent rounded-full animate-spin';
|
|
26
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl blockchain-card h-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-4", children: [(0, jsx_runtime_1.jsx)(IconCoin, { stroke: ac }), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-xs font-mono tracking-widest uppercase", children: t('mccStats', 'MCC_STATS') })] }), loading ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)("span", { className: spinnerClass, style: spinnerBorderColor }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 gap-3", children: stats.map((s) => {
|
|
27
|
-
const Icon = s.icon;
|
|
28
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 mb-1", children: [(0, jsx_runtime_1.jsx)(Icon, { stroke: ac }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] text-[#5EEAD4] font-mono tracking-widest uppercase", children: s.label })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg font-bold font-mono text-white", children: s.value != null ? s.format(s.value) : '--' })] }, s.label));
|
|
29
|
-
}) }))] }) }));
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl blockchain-card h-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsx)(IconCoinHeader, {}), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-[10px] sm:text-xs font-mono tracking-widest uppercase", children: t('mccStats', 'MCC_STATS') })] }), loading ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)(IconSpinner, {}) })) : ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 gap-2 sm:gap-3", children: stats.map((s) => ((0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 sm:p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 mb-1", children: [s.icon, (0, jsx_runtime_1.jsx)("span", { className: "text-[9px] sm:text-[10px] text-[#5EEAD4] font-mono tracking-widest uppercase", children: s.label })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm sm:text-lg font-bold font-mono text-white truncate", children: s.value != null ? s.format(s.value) : '--' })] }, s.label))) }))] }) }));
|
|
30
44
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export interface MicrocosmMCDStatsProps {
|
|
2
2
|
accentColor?: string;
|
|
3
3
|
}
|
|
4
|
-
export declare function MicrocosmMCDStats(
|
|
4
|
+
export declare function MicrocosmMCDStats(_props?: MicrocosmMCDStatsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,26 +5,40 @@ exports.MicrocosmMCDStats = MicrocosmMCDStats;
|
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const auth_react_1 = require("@microcosmmoney/auth-react");
|
|
7
7
|
const i18n_context_1 = require("../../i18n-context");
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
function MicrocosmMCDStats(
|
|
8
|
+
const IconUsers = () => ((0, jsx_runtime_1.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "#5EEAD4", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }), (0, jsx_runtime_1.jsx)("circle", { cx: "9", cy: "7", r: "4" }), (0, jsx_runtime_1.jsx)("path", { d: "M22 21v-2a4 4 0 0 0-3-3.87" }), (0, jsx_runtime_1.jsx)("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })] }));
|
|
9
|
+
const IconBuilding = () => ((0, jsx_runtime_1.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "#5EEAD4", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("rect", { width: "16", height: "20", x: "4", y: "2", rx: "2" }), (0, jsx_runtime_1.jsx)("path", { d: "M9 22v-4h6v4" }), (0, jsx_runtime_1.jsx)("path", { d: "M8 6h.01M16 6h.01M12 6h.01M12 10h.01M12 14h.01M16 10h.01M16 14h.01M8 10h.01M8 14h.01" })] }));
|
|
10
|
+
const IconClock = () => ((0, jsx_runtime_1.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "#5EEAD4", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "10" }), (0, jsx_runtime_1.jsx)("polyline", { points: "12 6 12 12 16 14" })] }));
|
|
11
|
+
const IconBanknote = () => ((0, jsx_runtime_1.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "#5EEAD4", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("rect", { width: "20", height: "12", x: "2", y: "6", rx: "2" }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "2" }), (0, jsx_runtime_1.jsx)("path", { d: "M6 12h.01M18 12h.01" })] }));
|
|
12
|
+
const IconBanknoteHeader = () => ((0, jsx_runtime_1.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#5EEAD4", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("rect", { width: "20", height: "12", x: "2", y: "6", rx: "2" }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "2" }), (0, jsx_runtime_1.jsx)("path", { d: "M6 12h.01M18 12h.01" })] }));
|
|
13
|
+
const IconSpinner = () => ((0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "#5EEAD4", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "animate-spin", children: (0, jsx_runtime_1.jsx)("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }));
|
|
14
|
+
function MicrocosmMCDStats(_props = {}) {
|
|
15
15
|
const t = (0, i18n_context_1.useTranslations)('mccDashboard');
|
|
16
16
|
const { data, loading } = (0, auth_react_1.useMCDStats)();
|
|
17
|
-
const ac = accentColor || '#22d3ee';
|
|
18
17
|
const stats = [
|
|
19
|
-
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
{
|
|
19
|
+
label: t('holders', 'holders'),
|
|
20
|
+
value: data?.holders_count,
|
|
21
|
+
format: (v) => v.toLocaleString(),
|
|
22
|
+
icon: (0, jsx_runtime_1.jsx)(IconUsers, {}),
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: t('activeVaults', 'active_vaults'),
|
|
26
|
+
value: data?.active_vaults,
|
|
27
|
+
format: (v) => v.toLocaleString(),
|
|
28
|
+
icon: (0, jsx_runtime_1.jsx)(IconBuilding, {}),
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: t('dailyDistribution', 'daily_distribution'),
|
|
32
|
+
value: data?.daily_distribution,
|
|
33
|
+
format: (v) => v > 0 ? v.toLocaleString('en-US', { maximumFractionDigits: 2 }) : '0',
|
|
34
|
+
icon: (0, jsx_runtime_1.jsx)(IconClock, {}),
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: t('totalVaultBalance', 'total_vault_balance'),
|
|
38
|
+
value: data?.total_vault_balance,
|
|
39
|
+
format: (v) => v > 0 ? `${(v / 1e6).toFixed(2)}M` : '0',
|
|
40
|
+
icon: (0, jsx_runtime_1.jsx)(IconBanknote, {}),
|
|
41
|
+
},
|
|
23
42
|
];
|
|
24
|
-
|
|
25
|
-
const spinnerClass = accentColor ? 'inline-block w-5 h-5 border-2 rounded-full animate-spin' : 'inline-block w-5 h-5 border-2 border-cyan-400 border-t-transparent rounded-full animate-spin';
|
|
26
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl blockchain-card h-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-4", children: [(0, jsx_runtime_1.jsx)(IconBanknote, { stroke: "#5EEAD4" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-xs font-mono tracking-widest uppercase", children: t('mcdStats', 'MCD_STATS') })] }), loading ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)("span", { className: spinnerClass, style: spinnerBorderColor }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 gap-3", children: stats.map((s) => {
|
|
27
|
-
const Icon = s.icon;
|
|
28
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 mb-1", children: [(0, jsx_runtime_1.jsx)(Icon, { stroke: "#5EEAD4" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] text-[#5EEAD4] font-mono tracking-widest uppercase", children: s.label })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg font-bold font-mono text-white", children: s.value != null ? s.format(s.value) : '--' })] }, s.label));
|
|
29
|
-
}) }))] }) }));
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl blockchain-card h-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsx)(IconBanknoteHeader, {}), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-[10px] sm:text-xs font-mono tracking-widest uppercase", children: t('mcdStats', 'MCD_STATS') })] }), loading ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)(IconSpinner, {}) })) : ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 gap-2 sm:gap-3", children: stats.map((s) => ((0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 sm:p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 mb-1", children: [s.icon, (0, jsx_runtime_1.jsx)("span", { className: "text-[9px] sm:text-[10px] text-[#5EEAD4] font-mono tracking-widest uppercase", children: s.label })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm sm:text-lg font-bold font-mono text-white truncate", children: s.value != null ? s.format(s.value) : '--' })] }, s.label))) }))] }) }));
|
|
30
44
|
}
|
|
@@ -19,18 +19,17 @@ const RANK_COLORS = {
|
|
|
19
19
|
Warden: 'text-cyan-300',
|
|
20
20
|
Admiral: 'text-cyan-300',
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const IconPickaxe = ({ stroke = '#22d3ee' }) => ((0, jsx_runtime_1.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: stroke, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M14.531 12.469 6.619 20.38a1 1 0 1 1-3-3l7.912-7.912" }), (0, jsx_runtime_1.jsx)("path", { d: "M15.686 4.314A12.5 12.5 0 0 0 5.461 2.958l-.834 2.22a5.25 5.25 0 0 0 4.626 7.065l.172-.003a5.25 5.25 0 0 0 5.022-3.89l.39-1.507a12.5 12.5 0 0 0 .849-2.53Z" })] }));
|
|
22
|
+
const IconPickaxe = ({ stroke = '#5EEAD4' }) => ((0, jsx_runtime_1.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: stroke, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M14.531 12.469 6.619 20.38a1 1 0 1 1-3-3l7.912-7.912" }), (0, jsx_runtime_1.jsx)("path", { d: "M15.686 4.314A12.5 12.5 0 0 0 5.461 2.958l-.834 2.22a5.25 5.25 0 0 0 4.626 7.065l.172-.003a5.25 5.25 0 0 0 5.022-3.89l.39-1.507a12.5 12.5 0 0 0 .849-2.53Z" })] }));
|
|
23
|
+
const IconTree = ({ stroke = '#5EEAD4' }) => ((0, jsx_runtime_1.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: stroke, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M12 22v-7" }), (0, jsx_runtime_1.jsx)("path", { d: "M7 15h10" }), (0, jsx_runtime_1.jsx)("path", { d: "m12 2-5.5 9h11Z" }), (0, jsx_runtime_1.jsx)("path", { d: "m12 7-4 6h8Z" })] }));
|
|
24
|
+
const IconBuilding = ({ stroke = '#5EEAD4' }) => ((0, jsx_runtime_1.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: stroke, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("rect", { width: "16", height: "20", x: "4", y: "2", rx: "2" }), (0, jsx_runtime_1.jsx)("path", { d: "M9 22v-4h6v4" }), (0, jsx_runtime_1.jsx)("path", { d: "M8 6h.01" }), (0, jsx_runtime_1.jsx)("path", { d: "M16 6h.01" }), (0, jsx_runtime_1.jsx)("path", { d: "M12 6h.01" }), (0, jsx_runtime_1.jsx)("path", { d: "M12 10h.01" }), (0, jsx_runtime_1.jsx)("path", { d: "M12 14h.01" }), (0, jsx_runtime_1.jsx)("path", { d: "M16 10h.01" }), (0, jsx_runtime_1.jsx)("path", { d: "M16 14h.01" }), (0, jsx_runtime_1.jsx)("path", { d: "M8 10h.01" }), (0, jsx_runtime_1.jsx)("path", { d: "M8 14h.01" })] }));
|
|
25
|
+
const IconLoader = ({ stroke = '#5EEAD4' }) => ((0, jsx_runtime_1.jsx)("svg", { className: "animate-spin", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: stroke, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: (0, jsx_runtime_1.jsx)("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }));
|
|
27
26
|
function getCompanionYield(rank) {
|
|
28
27
|
if (!rank)
|
|
29
28
|
return [];
|
|
30
29
|
return [
|
|
31
|
-
{ label: '\u653f\u52a1\u5b98', share: '40%', type: 'MCC' },
|
|
32
|
-
{ label: 'LP
|
|
33
|
-
{ label: '\u9886\u5730\u91d1\u5e93', share: '30%', type: 'MCD' },
|
|
30
|
+
{ label: '\u653f\u52a1\u5b98', share: '40%', type: 'MCC', icon: (0, jsx_runtime_1.jsx)(IconBuilding, { stroke: "#22d3ee" }) },
|
|
31
|
+
{ label: 'LP', share: '30%', type: 'MCC', icon: (0, jsx_runtime_1.jsx)(IconTree, { stroke: "#67e8f9" }) },
|
|
32
|
+
{ label: '\u9886\u5730\u91d1\u5e93', share: '30%', type: 'MCD', icon: (0, jsx_runtime_1.jsx)(IconBuilding, { stroke: "#67e8f9" }) },
|
|
34
33
|
];
|
|
35
34
|
}
|
|
36
35
|
function MicrocosmMiningWeight({ accentColor } = {}) {
|
|
@@ -39,14 +38,11 @@ function MicrocosmMiningWeight({ accentColor } = {}) {
|
|
|
39
38
|
const { data: techBonus, loading: loadingTech } = (0, auth_react_1.useTechBonusDetail)();
|
|
40
39
|
const { data: miningStats, loading: loadingMining } = (0, auth_react_1.useMiningStats)();
|
|
41
40
|
const loading = loadingLevel || loadingTech || loadingMining;
|
|
42
|
-
const
|
|
43
|
-
const rank = data?.current_rank?.toLowerCase() ?? null;
|
|
41
|
+
const rank = data?.current_rank ?? null;
|
|
44
42
|
const totalHoldings = data ? (data.holdings.station + data.holdings.matrix + data.holdings.sector + data.holdings.system) : 0;
|
|
45
43
|
const miningDays = totalHoldings > 0 ? totalHoldings : (miningStats?.active_days_30d ?? 0);
|
|
46
44
|
const companionYield = getCompanionYield(rank);
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
const spinnerClass = accentColor ? 'inline-block w-5 h-5 border-2 rounded-full animate-spin' : 'inline-block w-5 h-5 border-2 border-cyan-400 border-t-transparent rounded-full animate-spin';
|
|
51
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl blockchain-card h-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-4", children: [(0, jsx_runtime_1.jsx)(IconPickaxe, { stroke: "#5EEAD4" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-xs font-mono tracking-widest uppercase", children: t('miningWeight', 'MINING_WEIGHT') })] }), loading ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-12", children: (0, jsx_runtime_1.jsx)("span", { className: spinnerClass, style: spinnerBorderColor }) })) : ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-3 gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 mb-1", children: [(0, jsx_runtime_1.jsx)(IconShield, { stroke: "#5EEAD4" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-xs font-mono tracking-widest uppercase", children: t('level', 'level') })] }), (0, jsx_runtime_1.jsx)("div", { className: `text-sm font-bold font-mono ${accentColor ? '' : (RANK_COLORS[rank ?? ''] ?? 'text-neutral-500')}`, style: accentColor ? { color: accentColor } : undefined, children: rank ? RANK_LABELS[rank] ?? rank : t('na', 'N/A') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 mb-1", children: [(0, jsx_runtime_1.jsx)(IconTree, { stroke: "#5EEAD4" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-xs font-mono tracking-widest uppercase", children: t('techBonus', 'tech_bonus') })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm font-bold font-mono text-white", children: discountPct }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] text-neutral-500 font-mono", children: t('outputBoost', 'output boost') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 mb-1", children: [(0, jsx_runtime_1.jsx)(IconCalendar, { stroke: "#5EEAD4" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-xs font-mono tracking-widest uppercase", children: t('miningDays', 'mining_days') })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm font-bold font-mono text-white", children: miningDays }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] text-neutral-500 font-mono", children: t('cumulative', 'cumulative') })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[#5EEAD4] text-xs font-mono tracking-widest uppercase mb-3", children: t('companionYield', 'companion_yield') }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] text-neutral-500 font-mono mb-3", children: t('companionYieldDesc', 'Each mining produces companion yield, auto-injected into territory ecosystem') }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-2", children: companionYield.map((row) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between px-2 py-1.5 bg-neutral-900 rounded hover:bg-neutral-700 transition-colors", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-xs font-mono text-neutral-300", children: row.label }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-xs font-mono font-bold text-white", children: row.share }), (0, jsx_runtime_1.jsx)("span", { className: accentColor ? 'text-[10px] font-mono px-1.5 py-0.5 rounded' : 'text-[10px] font-mono px-1.5 py-0.5 rounded bg-cyan-400/20 text-cyan-400', style: accentColor ? { backgroundColor: `${accentColor}33`, color: accentColor } : undefined, children: row.type })] })] }, row.label))) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[10px] text-neutral-500 font-mono space-y-1", children: [(0, jsx_runtime_1.jsxs)("div", { children: ['\u6316\u77ff\u4ef7\u683c', " = ", '\u57fa\u51c6\u4ef7\u683c', " x 4 (", '\u7528\u6237\u83b7\u5f97', " 100% MCC)"] }), (0, jsx_runtime_1.jsxs)("div", { children: ['\u4f34\u751f\u77ff\u4e0e\u7528\u6237\u6316\u77ff\u91cf', " 1:1 ", '\u540c\u6b65\u4ea7\u51fa'] })] })] }))] }) }));
|
|
45
|
+
const totalBonus = techBonus?.total_bonus ?? 0;
|
|
46
|
+
const techDiscount = totalBonus ? `${totalBonus > 0 ? '-' : ''}${Math.abs(totalBonus)}%` : '--';
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl blockchain-card h-full hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsx)("div", { className: "p-3 sm:p-6", children: loading ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-12", children: (0, jsx_runtime_1.jsx)(IconLoader, { stroke: "#22d3ee" }) })) : ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-3 sm:space-y-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-3 gap-2 sm:gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 sm:p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 sm:gap-1.5 mb-1", children: [(0, jsx_runtime_1.jsx)(IconPickaxe, { stroke: "#5EEAD4" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-[9px] sm:text-xs font-mono tracking-widest uppercase", children: t('level', 'level') })] }), (0, jsx_runtime_1.jsx)("div", { className: `text-xs sm:text-sm font-bold font-mono truncate ${rank ? (RANK_COLORS[rank] ?? 'text-neutral-500') : 'text-neutral-500'}`, children: rank ? (RANK_LABELS[rank] ?? rank) : 'N/A' })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 sm:p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 sm:gap-1.5 mb-1", children: [(0, jsx_runtime_1.jsx)(IconTree, { stroke: "#5EEAD4" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-[9px] sm:text-xs font-mono tracking-widest uppercase", children: t('techBonus', 'tech_bonus') })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs sm:text-sm font-bold font-mono text-white", children: techDiscount })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 sm:p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 sm:gap-1.5 mb-1", children: [(0, jsx_runtime_1.jsx)(IconPickaxe, { stroke: "#5EEAD4" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-[9px] sm:text-xs font-mono tracking-widest uppercase", children: t('miningDays', 'mining_days') })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs sm:text-sm font-bold font-mono text-white", children: miningDays })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 sm:p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[#5EEAD4] text-[10px] sm:text-xs font-mono tracking-widest uppercase mb-2 sm:mb-3", children: t('ecosystemDistribution', 'ecosystem_distribution (\u4f34\u751f\u77ff)') }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] text-neutral-500 font-mono mb-2 sm:mb-3 hidden xs:block", children: t('companionYieldDesc', '\u6bcf\u6b21\u6316\u77ff\u540c\u6b65\u8fdb\u884c\u4f34\u751f\u77ff\uff0c\u81ea\u52a8\u6ce8\u5165\u9886\u5730\u751f\u6001') }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-2", children: companionYield.map((row) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between px-2 py-1.5 bg-neutral-900 rounded hover:bg-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [row.icon, (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-mono text-neutral-300", children: row.label })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-xs font-mono font-bold text-white", children: row.share }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] font-mono px-1.5 py-0.5 rounded bg-cyan-400/20 text-cyan-400", children: row.type })] })] }, row.label))) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[10px] text-neutral-500 font-mono space-y-1", children: [(0, jsx_runtime_1.jsx)("div", { children: t('miningPriceFormula', '\u6316\u77ff\u4ef7\u683c = \u5e02\u573a\u4ef7 x \u6316\u77ff\u500d\u6570 (\u79d1\u6280\u52a0\u6210\u53ef\u63d0\u5347\u4ea7\u51fa)') }), (0, jsx_runtime_1.jsx)("div", { children: t('companionYieldSync', '\u4f34\u751f\u77ff\u4e0e\u7528\u6237\u6316\u77ff\u91cf\u540c\u6b65\u8fdb\u884c') })] })] })) }) }));
|
|
52
48
|
}
|
|
@@ -5,24 +5,23 @@ exports.MicrocosmMintingStats = MicrocosmMintingStats;
|
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const auth_react_1 = require("@microcosmmoney/auth-react");
|
|
7
7
|
const i18n_context_1 = require("../../i18n-context");
|
|
8
|
+
const IconZap = ({ stroke = '#5EEAD4' }) => ((0, jsx_runtime_1.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: stroke, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: (0, jsx_runtime_1.jsx)("path", { d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z" }) }));
|
|
9
|
+
const IconLoader = ({ stroke = '#22d3ee' }) => ((0, jsx_runtime_1.jsx)("svg", { className: "animate-spin", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: stroke, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: (0, jsx_runtime_1.jsx)("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }));
|
|
8
10
|
function MicrocosmMintingStats({ accentColor } = {}) {
|
|
9
11
|
const t = (0, i18n_context_1.useTranslations)('mccDashboard');
|
|
10
12
|
const { data: mccStats, loading } = (0, auth_react_1.useMCCStats)();
|
|
11
13
|
const { data: mccPriceData } = (0, auth_react_1.useMCCPrice)();
|
|
12
14
|
const s = mccStats;
|
|
13
|
-
const totalMinted = s?.circulating_supply ?? 0;
|
|
15
|
+
const totalMinted = s?.circulating_supply ?? (s?.genesis_pool_balance ? 1000000000 - s.genesis_pool_balance : 0);
|
|
14
16
|
const currentStage = s?.current_phase ?? 0;
|
|
15
|
-
const
|
|
17
|
+
const difficultyRatio = 2 ** currentStage;
|
|
16
18
|
const nextHalving = s?.next_halving_at ?? 100000000;
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const spinnerClass = accentColor ? 'inline-block w-5 h-5 border-2 rounded-full animate-spin' : 'inline-block w-5 h-5 border-2 border-cyan-400 border-t-transparent rounded-full animate-spin';
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl blockchain-card h-full", children: (0, jsx_runtime_1.jsx)("div", { className: "p-6", children: loading ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)("span", { className: spinnerClass, style: spinnerBorderColor }) })) : ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [(0, jsx_runtime_1.jsx)("span", { className: accentColor ? '' : 'text-cyan-400', style: accentColor ? { color: accentColor } : undefined, children: "\u26A1" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-xs font-mono tracking-widest uppercase", children: t('mintingStats', 'MINTING_STATS') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-[#5EEAD4] font-mono tracking-widest uppercase mb-1", children: t('totalMinted', 'total_minted') }), (0, jsx_runtime_1.jsxs)("div", { className: "text-xl font-bold font-mono text-white", children: [totalMinted > 0 ? fmt(totalMinted) : '0', " MCC"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-[#5EEAD4] font-mono tracking-widest uppercase mb-1", children: t('miningPrice', 'mining_price') }), (0, jsx_runtime_1.jsxs)("div", { className: accentColor ? 'text-xl font-bold font-mono' : 'text-xl font-bold font-mono text-cyan-400', style: accentColor ? { color: accentColor } : undefined, children: ["$", miningPrice > 0 ? miningPrice.toFixed(4) : '--'] }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] text-neutral-500 font-mono", children: t('baseTimes4', 'base × 4') })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center mb-2 text-sm font-mono", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: t('nextHalving', 'next_halving') }), (0, jsx_runtime_1.jsxs)("span", { className: "text-white", children: [nextHalving > totalMinted
|
|
19
|
+
const miningPrice = mccPriceData?.miningPrice ?? (mccPriceData?.base_price ? mccPriceData.base_price * 4 : 0);
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl blockchain-card h-full hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsx)("div", { className: "p-3 sm:p-6", children: loading ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)(IconLoader, { stroke: "#22d3ee" }) })) : ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-3 sm:space-y-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-1 sm:mb-2", children: [(0, jsx_runtime_1.jsx)(IconZap, { stroke: "#5EEAD4" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-[10px] sm:text-xs font-mono tracking-widest uppercase", children: t('mintingStats', 'MINTING_STATS') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-2 sm:gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 sm:p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-[#5EEAD4] font-mono tracking-widest uppercase mb-1", children: t('totalMinted', 'total_minted') }), (0, jsx_runtime_1.jsxs)("div", { className: "text-sm sm:text-xl font-bold font-mono text-white truncate", children: [totalMinted > 0
|
|
21
|
+
? totalMinted.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
|
22
|
+
: '0', " MCC"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 sm:p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-[#5EEAD4] font-mono tracking-widest uppercase mb-1", children: t('miningPrice', 'mining_price') }), (0, jsx_runtime_1.jsxs)("div", { className: "text-sm sm:text-xl font-bold font-mono text-cyan-400", children: ["$", miningPrice > 0 ? miningPrice.toFixed(4) : '--'] }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] text-neutral-500 font-mono", children: t('oracleX4', 'oracle \u00d7 4') })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 sm:p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center mb-2 text-xs sm:text-sm font-mono", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: t('nextHalving', 'next_halving') }), (0, jsx_runtime_1.jsxs)("span", { className: "text-white", children: [nextHalving > totalMinted
|
|
23
23
|
? (nextHalving - totalMinted).toLocaleString('en-US', { maximumFractionDigits: 0 })
|
|
24
|
-
:
|
|
24
|
+
: 'N/A', " MCC"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "w-full bg-neutral-700 rounded-full h-2", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-cyan-400 h-2 rounded-full transition-all", style: {
|
|
25
25
|
width: nextHalving > 0 ? `${Math.min((totalMinted % nextHalving) / nextHalving * 100, 100)}%` : '0%',
|
|
26
|
-
|
|
27
|
-
} }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center mt-2 text-xs text-neutral-500 font-mono", children: [(0, jsx_runtime_1.jsxs)("span", { children: [t('phase', 'phase'), ": ", currentStage, " | ", t('rate', 'rate'), ": ", miningRate > 0 ? `${miningRate}:1` : '--'] }), (0, jsx_runtime_1.jsxs)("span", { children: [t('threshold', 'threshold'), ": ", (nextHalving / 1e6).toFixed(0), "M"] })] })] })] })) }) }));
|
|
26
|
+
} }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center mt-2 text-[10px] sm:text-xs text-neutral-500 font-mono", children: [(0, jsx_runtime_1.jsxs)("span", { children: [t('phase', 'phase'), ": ", currentStage, " | ", t('difficulty', 'difficulty'), ": ", difficultyRatio, ":1"] }), (0, jsx_runtime_1.jsxs)("span", { children: [t('threshold', 'threshold'), ": ", (nextHalving / 1e6).toFixed(0), "M"] })] })] })] })) }) }));
|
|
28
27
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export interface MicrocosmMyMiningProps {
|
|
2
|
+
basePath?: string;
|
|
2
3
|
detailsPath?: string;
|
|
3
4
|
onNavigate?: (path: string) => void;
|
|
4
5
|
accentColor?: string;
|
|
5
6
|
}
|
|
6
|
-
export declare function MicrocosmMyMining({
|
|
7
|
+
export declare function MicrocosmMyMining({ basePath, detailsPath, accentColor }: MicrocosmMyMiningProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,9 +5,12 @@ exports.MicrocosmMyMining = MicrocosmMyMining;
|
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const auth_react_1 = require("@microcosmmoney/auth-react");
|
|
7
7
|
const i18n_context_1 = require("../../i18n-context");
|
|
8
|
-
|
|
8
|
+
const link_context_1 = require("../../link-context");
|
|
9
|
+
function MicrocosmMyMining({ basePath = '', detailsPath, accentColor }) {
|
|
9
10
|
const t = (0, i18n_context_1.useTranslations)('mccDashboard');
|
|
10
|
-
const
|
|
11
|
+
const Link = (0, link_context_1.useLinkComponent)();
|
|
12
|
+
const { data: stats, loading } = (0, auth_react_1.useMiningStats)();
|
|
13
|
+
const resolvedDetails = detailsPath ?? (basePath ? `${basePath.replace(/\/$/, '')}/mcc/mining` : '/mcc/mining');
|
|
11
14
|
const fmt = (v) => v.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
12
15
|
const formatDateTime = (iso) => {
|
|
13
16
|
if (!iso)
|
|
@@ -15,19 +18,24 @@ function MicrocosmMyMining({ detailsPath, onNavigate, accentColor }) {
|
|
|
15
18
|
const d = new Date(iso);
|
|
16
19
|
return d.toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' });
|
|
17
20
|
};
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const iconCls = 'w-3.5 h-3.5 text-cyan-400';
|
|
22
|
+
const coinsIcon = ((0, jsx_runtime_1.jsxs)("svg", { className: iconCls, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "8", strokeWidth: 2 }), (0, jsx_runtime_1.jsx)("path", { strokeWidth: 2, strokeLinecap: "round", d: "M12 8v8M9 11h6M9 14h6" })] }));
|
|
23
|
+
const dollarIcon = ((0, jsx_runtime_1.jsx)("svg", { className: iconCls, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8c-2 0-3 1-3 2s1 2 3 2 3 1 3 2-1 2-3 2m0-8V6m0 12v-2M4 12a8 8 0 1016 0 8 8 0 00-16 0z" }) }));
|
|
24
|
+
const hashIcon = ((0, jsx_runtime_1.jsx)("svg", { className: iconCls, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 9h16M4 15h16M10 3L8 21M16 3l-2 18" }) }));
|
|
25
|
+
const calendarIcon = ((0, jsx_runtime_1.jsx)("svg", { className: iconCls, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }));
|
|
26
|
+
const timerIcon = ((0, jsx_runtime_1.jsxs)("svg", { className: iconCls, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "13", r: "8", strokeWidth: 2 }), (0, jsx_runtime_1.jsx)("path", { strokeWidth: 2, strokeLinecap: "round", d: "M12 9v4l2 2M9 3h6" })] }));
|
|
27
|
+
const clockIcon = ((0, jsx_runtime_1.jsxs)("svg", { className: iconCls, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "9", strokeWidth: 2 }), (0, jsx_runtime_1.jsx)("path", { strokeWidth: 2, strokeLinecap: "round", d: "M12 7v5l3 2" })] }));
|
|
28
|
+
const pickaxeIcon = ((0, jsx_runtime_1.jsx)("svg", { className: "w-4 h-4 text-cyan-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M14 6l6 6-3 3-6-6 3-3zM10 10l-6 10 10-6" }) }));
|
|
29
|
+
const chevronRight = ((0, jsx_runtime_1.jsx)("svg", { className: "w-3 h-3 inline", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) }));
|
|
30
|
+
const items = stats ? [
|
|
31
|
+
{ label: 'total_mined', value: fmt(stats.total_mined ?? 0), icon: coinsIcon },
|
|
32
|
+
{ label: 'total_paid', value: fmt(stats.total_paid ?? 0), icon: dollarIcon },
|
|
33
|
+
{ label: 'mining_count', value: `${stats.mining_count ?? 0}`, icon: hashIcon },
|
|
34
|
+
{ label: 'last_30d', value: fmt(stats.last_30d_mined ?? 0), icon: calendarIcon },
|
|
35
|
+
{ label: 'active_days', value: `${stats.active_days_30d ?? 0}`, icon: timerIcon },
|
|
36
|
+
{ label: 'last_mined', value: formatDateTime(stats.last_mined_at), icon: clockIcon },
|
|
25
37
|
] : [];
|
|
26
|
-
const handleDetailsClick = () => {
|
|
27
|
-
if (onNavigate && detailsPath)
|
|
28
|
-
onNavigate(detailsPath);
|
|
29
|
-
};
|
|
30
38
|
const spinnerBorderColor = accentColor ? { borderColor: accentColor, borderTopColor: 'transparent' } : undefined;
|
|
31
39
|
const spinnerClass = accentColor ? 'inline-block w-5 h-5 border-2 rounded-full animate-spin' : 'inline-block w-5 h-5 border-2 border-cyan-400 border-t-transparent rounded-full animate-spin';
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl blockchain-card h-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-xs font-mono tracking-widest uppercase", children: t('myMining', 'MY_MINING') }),
|
|
40
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl blockchain-card h-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [pickaxeIcon, (0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] text-[10px] sm:text-xs font-mono tracking-widest uppercase", children: t('myMining', 'MY_MINING') })] }), (0, jsx_runtime_1.jsxs)(Link, { href: resolvedDetails, className: "flex items-center gap-1 text-xs text-neutral-500 hover:text-cyan-400 font-mono", children: [t('details', 'details'), " ", chevronRight] })] }), loading ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)("span", { className: spinnerClass, style: spinnerBorderColor }) })) : !stats || (stats.mining_count ?? 0) === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-8 text-neutral-500 font-mono text-sm", children: t('noMiningRecords', 'no mining records') })) : ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 gap-2 sm:gap-3", children: items.map((s) => ((0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 sm:p-3 blockchain-sub-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 mb-1", children: [s.icon, (0, jsx_runtime_1.jsx)("span", { className: "text-[9px] sm:text-[10px] text-[#5EEAD4] font-mono tracking-widest uppercase", children: s.label })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm sm:text-xl font-bold font-mono text-white truncate", children: s.value })] }, s.label))) }))] }) }));
|
|
33
41
|
}
|
|
@@ -7,41 +7,78 @@ const react_1 = require("react");
|
|
|
7
7
|
const auth_react_1 = require("@microcosmmoney/auth-react");
|
|
8
8
|
const i18n_context_1 = require("../../i18n-context");
|
|
9
9
|
const recharts_1 = require("recharts");
|
|
10
|
-
const
|
|
10
|
+
const TIME_RANGES = [
|
|
11
11
|
{ label: '1D', value: '1D' },
|
|
12
12
|
{ label: '7D', value: '7D' },
|
|
13
13
|
{ label: '30D', value: '30D' },
|
|
14
|
+
{ label: '1Y', value: '1Y' },
|
|
14
15
|
];
|
|
16
|
+
function computeChange(data) {
|
|
17
|
+
if (!data || data.length < 2)
|
|
18
|
+
return null;
|
|
19
|
+
const prices = data
|
|
20
|
+
.map((d) => d.market_price ?? d.close ?? d.price ?? 0)
|
|
21
|
+
.filter((p) => p > 0);
|
|
22
|
+
if (prices.length < 2)
|
|
23
|
+
return null;
|
|
24
|
+
const first = prices[0];
|
|
25
|
+
const last = prices[prices.length - 1];
|
|
26
|
+
if (first <= 0)
|
|
27
|
+
return null;
|
|
28
|
+
return ((last - first) / first) * 100;
|
|
29
|
+
}
|
|
15
30
|
function MicrocosmPriceChart({ accentColor } = {}) {
|
|
16
31
|
const t = (0, i18n_context_1.useTranslations)('mccDashboard');
|
|
32
|
+
const api = (0, auth_react_1.useMicrocosmApi)();
|
|
17
33
|
const [range, setRange] = (0, react_1.useState)('7D');
|
|
18
34
|
const { data, loading } = (0, auth_react_1.usePriceHistory)(range);
|
|
19
35
|
const gradientId = (0, react_1.useId)().replace(/:/g, '_') + '_mcPriceGradient';
|
|
20
36
|
const ac = accentColor || '#22d3ee';
|
|
37
|
+
const [rangeChanges, setRangeChanges] = (0, react_1.useState)({});
|
|
38
|
+
(0, react_1.useEffect)(() => {
|
|
39
|
+
const ranges = ['1D', '7D', '30D', '1Y'];
|
|
40
|
+
ranges.forEach(async (r) => {
|
|
41
|
+
try {
|
|
42
|
+
const json = await api.get(`/stats/price-history?range=${r}`);
|
|
43
|
+
const payload = json?.data ?? json;
|
|
44
|
+
if (Array.isArray(payload)) {
|
|
45
|
+
setRangeChanges(prev => ({ ...prev, [r]: computeChange(payload) }));
|
|
46
|
+
}
|
|
47
|
+
else if (payload?.records) {
|
|
48
|
+
setRangeChanges(prev => ({ ...prev, [r]: computeChange(payload.records) }));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch { }
|
|
52
|
+
});
|
|
53
|
+
}, [api]);
|
|
21
54
|
const raw = data;
|
|
22
55
|
const items = Array.isArray(raw) ? raw : raw?.records ?? [];
|
|
23
56
|
const chartData = items.map((item) => ({
|
|
24
57
|
time: typeof item.timestamp === 'number'
|
|
25
58
|
? (item.timestamp < 1e12 ? item.timestamp * 1000 : item.timestamp)
|
|
26
59
|
: new Date(item.timestamp).getTime(),
|
|
27
|
-
price: item.
|
|
28
|
-
}));
|
|
60
|
+
price: item.market_price ?? item.close ?? item.price ?? 0,
|
|
61
|
+
})).filter((d) => d.price > 0);
|
|
29
62
|
const prices = chartData.map((d) => d.price);
|
|
30
63
|
const minPrice = prices.length > 0 ? Math.min(...prices) * 0.995 : 0;
|
|
31
64
|
const maxPrice = prices.length > 0 ? Math.max(...prices) * 1.005 : 1;
|
|
65
|
+
const currentPrice = prices.length > 0 ? prices[prices.length - 1] : null;
|
|
32
66
|
const formatTime = (ts) => {
|
|
33
67
|
const d = new Date(ts);
|
|
34
68
|
if (range === '1D')
|
|
35
69
|
return d.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit', hour12: false });
|
|
36
70
|
return d.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
|
|
37
71
|
};
|
|
38
|
-
return ((0, jsx_runtime_1.
|
|
39
|
-
|
|
40
|
-
|
|
72
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "backdrop-blur-md bg-white/5 border border-white/10 rounded-xl overflow-hidden blockchain-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col sm:flex-row items-stretch border-b border-white/10", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-1 flex-col justify-center gap-1 px-3 py-2 sm:px-6 sm:py-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-mono font-bold text-sm sm:text-base", children: t('mccPriceTrend', 'MCC Price Trend') }), (0, jsx_runtime_1.jsxs)("div", { className: "text-neutral-500 font-mono text-xs", children: [currentPrice ? `$${currentPrice.toFixed(4)}` : '--', rangeChanges[range] != null && ((0, jsx_runtime_1.jsxs)("span", { className: `ml-2 ${rangeChanges[range] >= 0 ? 'text-cyan-400' : 'text-red-400'}`, children: [rangeChanges[range] >= 0 ? '+' : '', rangeChanges[range].toFixed(2), "%"] }))] })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex", children: TIME_RANGES.map((tr) => {
|
|
73
|
+
const isActive = range === tr.value;
|
|
74
|
+
const change = rangeChanges[tr.value];
|
|
75
|
+
const isPositive = change != null && change >= 0;
|
|
76
|
+
return ((0, jsx_runtime_1.jsxs)("button", { "data-active": isActive, className: `relative z-10 flex flex-1 flex-col justify-center gap-1 border-t border-white/10 px-4 py-3 text-left even:border-l even:border-white/10 sm:border-t-0 sm:border-l sm:border-white/10 sm:px-5 sm:py-4 transition-colors ${isActive ? 'bg-white/10' : 'hover:bg-white/5'}`, onClick: () => setRange(tr.value), children: [(0, jsx_runtime_1.jsx)("span", { className: "text-[10px] text-neutral-500 font-mono tracking-wider", children: tr.label }), change == null ? ((0, jsx_runtime_1.jsx)("span", { className: "text-lg font-bold leading-none text-neutral-600 font-mono sm:text-xl", children: "..." })) : ((0, jsx_runtime_1.jsxs)("span", { className: `text-lg font-bold leading-none font-mono sm:text-xl tabular-nums ${isPositive ? 'text-cyan-400' : 'text-red-400'}`, children: [isPositive ? '+' : '', change.toFixed(2), "%"] }))] }, tr.value));
|
|
77
|
+
}) })] }), (0, jsx_runtime_1.jsx)("div", { className: "p-3 sm:p-6", children: (0, jsx_runtime_1.jsx)("div", { className: "h-[220px] xs:h-[280px] sm:h-[360px]", children: loading ? ((0, jsx_runtime_1.jsx)("div", { className: "h-full bg-neutral-800 rounded animate-pulse" })) : chartData.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "h-full flex items-center justify-center text-neutral-500 font-mono text-sm", children: t('noPriceData', 'No price data available') })) : ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, { width: "100%", height: "100%", children: (0, jsx_runtime_1.jsxs)(recharts_1.AreaChart, { data: chartData, margin: { top: 5, right: 5, left: -15, bottom: 0 }, children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [(0, jsx_runtime_1.jsx)("stop", { offset: "5%", stopColor: ac, stopOpacity: 0.3 }), (0, jsx_runtime_1.jsx)("stop", { offset: "95%", stopColor: ac, stopOpacity: 0 })] }) }), (0, jsx_runtime_1.jsx)(recharts_1.CartesianGrid, { vertical: false, strokeDasharray: "3 3", stroke: "#404040" }), (0, jsx_runtime_1.jsx)(recharts_1.XAxis, { dataKey: "time", tick: { fill: '#737373', fontSize: 10, fontFamily: 'monospace' }, tickLine: false, axisLine: false, tickFormatter: formatTime }), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, { tick: { fill: '#737373', fontSize: 10, fontFamily: 'monospace' }, tickLine: false, axisLine: false, tickFormatter: (v) => `$${v.toFixed(3)}`, domain: [minPrice, maxPrice] }), (0, jsx_runtime_1.jsx)(recharts_1.Tooltip, { contentStyle: {
|
|
41
78
|
backgroundColor: '#171717',
|
|
42
79
|
border: '1px solid #404040',
|
|
43
80
|
borderRadius: '6px',
|
|
44
81
|
fontFamily: 'monospace',
|
|
45
82
|
fontSize: '11px',
|
|
46
|
-
}, labelFormatter: (ts) => new Date(ts).toLocaleString(), formatter: (value) => [`$${Number(value).toFixed(4)}`, t('price', 'Price')] }), (0, jsx_runtime_1.jsx)(recharts_1.Area, { type: "monotone", dataKey: "price", stroke: ac, strokeWidth: 2, fill: `url(#${gradientId})` })] }) })) })
|
|
83
|
+
}, labelFormatter: (ts) => new Date(ts).toLocaleString(), formatter: (value) => [`$${Number(value).toFixed(4)}`, t('price', 'Price')] }), (0, jsx_runtime_1.jsx)(recharts_1.Area, { type: "monotone", dataKey: "price", stroke: ac, strokeWidth: 2, fill: `url(#${gradientId})` })] }) })) }) })] }));
|
|
47
84
|
}
|
|
@@ -6,62 +6,76 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
6
6
|
const MCC_MINT = 'MCCn6eqiTGzaiPKECg3viPmkdkS9YmkguqKvRcTxCsb';
|
|
7
7
|
const USDC_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
|
|
8
8
|
const POOL_ID = '4AiaTd9bAWf3u8ScZWhXadJF1roc8bJKEKvaDudKacZd';
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
9
|
+
const RAYDIUM_POOL_URL = `https://raydium.io/swap/?inputMint=${MCC_MINT}&outputMint=${USDC_MINT}`;
|
|
10
|
+
const JUPITER_TRADE_URL = `https://jup.ag/swap/USDT-${MCC_MINT}`;
|
|
11
|
+
const BIRDEYE_TOKEN_URL = `https://birdeye.so/token/${MCC_MINT}?chain=solana`;
|
|
12
|
+
const GMGN_TOKEN_URL = `https://gmgn.ai/sol/token/${MCC_MINT}`;
|
|
13
|
+
const OKX_DEX_URL = `https://www.okx.com/web3/dex-swap#inputChain=501&inputCurrency=${USDC_MINT}&outputChain=501&outputCurrency=${MCC_MINT}`;
|
|
14
|
+
const DEXSCREENER_URL = `https://dexscreener.com/solana/${POOL_ID}`;
|
|
15
|
+
const IconDroplets = ({ stroke = 'currentColor' }) => ((0, jsx_runtime_1.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: stroke, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0 sm:w-5 sm:h-5", children: [(0, jsx_runtime_1.jsx)("path", { d: "M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z" }), (0, jsx_runtime_1.jsx)("path", { d: "M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97" })] }));
|
|
16
|
+
const IconRepeat = ({ stroke = 'currentColor' }) => ((0, jsx_runtime_1.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: stroke, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0 sm:w-5 sm:h-5", children: [(0, jsx_runtime_1.jsx)("path", { d: "m17 1 4 4-4 4" }), (0, jsx_runtime_1.jsx)("path", { d: "M3 11V9a4 4 0 0 1 4-4h14" }), (0, jsx_runtime_1.jsx)("path", { d: "m7 23-4-4 4-4" }), (0, jsx_runtime_1.jsx)("path", { d: "M21 13v2a4 4 0 0 1-4 4H3" })] }));
|
|
17
|
+
const IconEye = ({ stroke = 'currentColor' }) => ((0, jsx_runtime_1.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: stroke, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0 sm:w-5 sm:h-5", children: [(0, jsx_runtime_1.jsx)("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "3" })] }));
|
|
18
|
+
const IconBarChart3 = ({ stroke = 'currentColor' }) => ((0, jsx_runtime_1.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: stroke, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0 sm:w-5 sm:h-5", children: [(0, jsx_runtime_1.jsx)("path", { d: "M3 3v18h18" }), (0, jsx_runtime_1.jsx)("path", { d: "M18 17V9" }), (0, jsx_runtime_1.jsx)("path", { d: "M13 17V5" }), (0, jsx_runtime_1.jsx)("path", { d: "M8 17v-3" })] }));
|
|
19
|
+
const IconLineChart = ({ stroke = 'currentColor' }) => ((0, jsx_runtime_1.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: stroke, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0 sm:w-5 sm:h-5", children: [(0, jsx_runtime_1.jsx)("path", { d: "M3 3v18h18" }), (0, jsx_runtime_1.jsx)("path", { d: "m19 9-5 5-4-4-3 3" })] }));
|
|
15
20
|
function buildExchanges(accentColor) {
|
|
16
21
|
const accentClass = accentColor ? 'border-neutral-700 hover:bg-neutral-800' : 'text-cyan-300 border-cyan-400/30 hover:bg-cyan-950/30';
|
|
22
|
+
const accentStyle = accentColor ? { color: accentColor } : undefined;
|
|
17
23
|
return [
|
|
18
24
|
{
|
|
19
|
-
label: '
|
|
20
|
-
href:
|
|
25
|
+
label: 'OKX DEX',
|
|
26
|
+
href: OKX_DEX_URL,
|
|
27
|
+
icon: IconRepeat,
|
|
21
28
|
color: accentClass,
|
|
22
|
-
colorStyle:
|
|
29
|
+
colorStyle: accentStyle,
|
|
30
|
+
iconAccent: true,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: 'Raydium',
|
|
34
|
+
href: RAYDIUM_POOL_URL,
|
|
23
35
|
icon: IconDroplets,
|
|
36
|
+
color: accentClass,
|
|
37
|
+
colorStyle: accentStyle,
|
|
24
38
|
iconAccent: true,
|
|
25
39
|
},
|
|
26
40
|
{
|
|
27
41
|
label: 'Jupiter',
|
|
28
|
-
href:
|
|
42
|
+
href: JUPITER_TRADE_URL,
|
|
43
|
+
icon: IconRepeat,
|
|
29
44
|
color: 'text-white border-neutral-700 hover:bg-neutral-800',
|
|
30
45
|
colorStyle: undefined,
|
|
31
|
-
icon: IconRepeat,
|
|
32
46
|
iconAccent: false,
|
|
33
47
|
},
|
|
34
48
|
{
|
|
35
49
|
label: 'BirdEye',
|
|
36
|
-
href:
|
|
37
|
-
color: accentClass,
|
|
38
|
-
colorStyle: accentColor ? { color: accentColor } : undefined,
|
|
50
|
+
href: BIRDEYE_TOKEN_URL,
|
|
39
51
|
icon: IconEye,
|
|
52
|
+
color: accentClass,
|
|
53
|
+
colorStyle: accentStyle,
|
|
40
54
|
iconAccent: true,
|
|
41
55
|
},
|
|
42
56
|
{
|
|
43
57
|
label: 'GMGN',
|
|
44
|
-
href:
|
|
58
|
+
href: GMGN_TOKEN_URL,
|
|
59
|
+
icon: IconBarChart3,
|
|
45
60
|
color: 'text-white border-neutral-700 hover:bg-neutral-800',
|
|
46
61
|
colorStyle: undefined,
|
|
47
|
-
icon: IconBarChart3,
|
|
48
62
|
iconAccent: false,
|
|
49
63
|
},
|
|
50
64
|
{
|
|
51
65
|
label: 'DexScreener',
|
|
52
|
-
href:
|
|
53
|
-
color: accentClass,
|
|
54
|
-
colorStyle: accentColor ? { color: accentColor } : undefined,
|
|
66
|
+
href: DEXSCREENER_URL,
|
|
55
67
|
icon: IconLineChart,
|
|
68
|
+
color: accentClass,
|
|
69
|
+
colorStyle: accentStyle,
|
|
56
70
|
iconAccent: true,
|
|
57
71
|
},
|
|
58
72
|
];
|
|
59
73
|
}
|
|
60
74
|
function MicrocosmQuickActions({ basePath = '', onNavigate, accentColor }) {
|
|
61
75
|
const exchanges = buildExchanges(accentColor);
|
|
62
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "mb-6", children: (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-
|
|
76
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "mb-3 sm:mb-6", children: (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-3 xs:grid-cols-3 sm:grid-cols-4 lg:grid-cols-6 gap-2 sm:gap-3", children: exchanges.map((ex) => {
|
|
63
77
|
const Icon = ex.icon;
|
|
64
78
|
const iconStroke = ex.iconAccent && accentColor ? accentColor : undefined;
|
|
65
|
-
return ((0, jsx_runtime_1.jsx)("a", { href: ex.href, target: "_blank", rel: "noopener noreferrer", children: (0, jsx_runtime_1.jsxs)("div", { className: `backdrop-blur-md bg-white/5 border ${ex.color} rounded-xl p-4 flex items-center gap-3 cursor-pointer active:scale-[0.98] blockchain-card`, style: ex.colorStyle, children: [(0, jsx_runtime_1.jsx)(Icon, { stroke: iconStroke }), (0, jsx_runtime_1.jsx)("span", { className: "font-mono text-sm font-bold tracking-wider", children: ex.label })] }) }, ex.label));
|
|
79
|
+
return ((0, jsx_runtime_1.jsx)("a", { href: ex.href, target: "_blank", rel: "noopener noreferrer", children: (0, jsx_runtime_1.jsxs)("div", { className: `backdrop-blur-md bg-white/5 border ${ex.color} rounded-xl p-2.5 sm:p-4 flex items-center gap-2 sm:gap-3 cursor-pointer active:scale-[0.98] blockchain-card`, style: ex.colorStyle, children: [(0, jsx_runtime_1.jsx)(Icon, { stroke: iconStroke }), (0, jsx_runtime_1.jsx)("span", { className: "font-mono text-xs sm:text-sm font-bold tracking-wider truncate", children: ex.label })] }) }, ex.label));
|
|
66
80
|
}) }) }));
|
|
67
81
|
}
|