@microcosmmoney/portal-react 3.10.0 → 3.11.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.
Files changed (32) hide show
  1. package/dist/components/auction/auction-page.js +11 -9
  2. package/dist/components/dashboard/assets-summary.js +5 -3
  3. package/dist/components/dashboard/dashboard-overview.js +5 -2
  4. package/dist/components/dashboard/ecosystem-stats.js +7 -5
  5. package/dist/components/dashboard/lock-periods.js +3 -1
  6. package/dist/components/dashboard/market-overview-bar.js +8 -6
  7. package/dist/components/dashboard/mcc-token-stats.js +7 -5
  8. package/dist/components/dashboard/mcd-stats.js +7 -5
  9. package/dist/components/dashboard/mining-weight.js +3 -1
  10. package/dist/components/dashboard/minting-stats.js +5 -3
  11. package/dist/components/dashboard/my-mining.js +9 -7
  12. package/dist/components/dashboard/price-chart.js +4 -2
  13. package/dist/components/fragment/fragment-page.js +3 -1
  14. package/dist/components/income/manager-income-page.js +5 -3
  15. package/dist/components/lending/lending-page.js +3 -1
  16. package/dist/components/mcd/mcd-page.js +7 -5
  17. package/dist/components/mining/mining-page.js +5 -3
  18. package/dist/components/profile/email-change-card.js +5 -3
  19. package/dist/components/profile/profile-page.js +10 -8
  20. package/dist/components/profile/two-factor-settings.js +6 -4
  21. package/dist/components/queue/queue-status-page.js +4 -2
  22. package/dist/components/reincarnation/reincarnation-page.js +6 -2
  23. package/dist/components/rewards/rewards-page.js +5 -3
  24. package/dist/components/stations/station-list-page.js +10 -8
  25. package/dist/components/territory/territory-page.js +5 -3
  26. package/dist/components/voting/voting-page.js +3 -1
  27. package/dist/components/wallet/wallet-page.js +9 -6
  28. package/dist/i18n-context.d.ts +11 -0
  29. package/dist/i18n-context.js +59 -0
  30. package/dist/index.d.ts +2 -0
  31. package/dist/index.js +6 -2
  32. package/package.json +1 -1
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.MicrocosmTerritoryPage = MicrocosmTerritoryPage;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const react_1 = require("react");
7
+ const i18n_context_1 = require("../../i18n-context");
7
8
  const auth_react_1 = require("@microcosmmoney/auth-react");
8
9
  const recharts_1 = require("recharts");
9
10
  /* ------------------------------------------------------------------ */
@@ -198,6 +199,7 @@ function TerritoryDetailView({ territoryId, territory, onBack }) {
198
199
  /* Main Component */
199
200
  /* ------------------------------------------------------------------ */
200
201
  function MicrocosmTerritoryPage({ basePath = '', onNavigate }) {
202
+ const t = (0, i18n_context_1.useTranslations)('territoryDash');
201
203
  const [selectedId, setSelectedId] = (0, react_1.useState)(null);
202
204
  const [filterType, setFilterType] = (0, react_1.useState)('all');
203
205
  const [searchTerm, setSearchTerm] = (0, react_1.useState)('');
@@ -228,12 +230,12 @@ function MicrocosmTerritoryPage({ basePath = '', onNavigate }) {
228
230
  if (summaryLoading && territoriesLoading) {
229
231
  return ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-between", children: (0, jsx_runtime_1.jsx)(Skeleton, { className: "h-8 w-56" }) }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4", children: [...Array(4)].map((_, i) => (0, jsx_runtime_1.jsx)(Skeleton, { className: "h-24" }, i)) }), (0, jsx_runtime_1.jsx)(Skeleton, { className: "h-14" }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: [...Array(6)].map((_, i) => (0, jsx_runtime_1.jsx)(Skeleton, { className: "h-72" }, i)) })] }));
230
232
  }
231
- return ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-2xl font-bold text-white", children: "Territory Management" }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 text-sm mt-1", children: "Manage territories, view KPI and vault balances" })] }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4", children: [
233
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-2xl font-bold text-white", children: t('title', 'Territory Management') }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 text-sm mt-1", children: t('subtitle', 'Manage territories, view KPI and vault balances') })] }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4", children: [
232
234
  { label: 'Total Territories', value: sum?.total_stations ?? 0, icon: (0, jsx_runtime_1.jsx)(IconBuilding2, { className: "w-4 h-4 text-cyan-400" }), suffix: '' },
233
235
  { label: 'Total Members', value: sum?.total_members ?? 0, icon: (0, jsx_runtime_1.jsx)(IconUsers, { className: "w-4 h-4 text-neutral-400" }), suffix: '' },
234
236
  { label: 'Total Vault MCD', value: Math.round(sum?.total_vault_mcd ?? 0), icon: (0, jsx_runtime_1.jsx)(IconVault, { className: "w-4 h-4 text-neutral-400" }), suffix: ' MCD' },
235
237
  { label: 'Avg KPI', value: sum?.avg_kpi_score != null ? Math.round(sum.avg_kpi_score * 100) : 0, icon: (0, jsx_runtime_1.jsx)(IconEdit3, { className: "w-4 h-4 text-neutral-400" }), suffix: '%' },
236
- ].map((s) => ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [s.icon, (0, jsx_runtime_1.jsx)("span", { className: "text-sm text-neutral-400", children: s.label })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-2xl font-bold text-white font-mono", children: summaryLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [fmt(s.value), s.suffix] }) })] }, s.label))) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors p-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col sm:flex-row gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "relative flex-1", children: [(0, jsx_runtime_1.jsx)(IconSearch, { className: "w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-neutral-500" }), (0, jsx_runtime_1.jsx)("input", { type: "text", placeholder: "Search territories...", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), className: "w-full pl-10 pr-3 py-2 bg-neutral-800 border border-neutral-700 rounded-lg text-white text-sm placeholder:text-neutral-500 outline-none focus:border-cyan-400/50 transition-colors" })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex gap-2 flex-wrap", children: UNIT_TYPE_LABELS.map((ut) => ((0, jsx_runtime_1.jsx)("button", { onClick: () => setFilterType(ut.key), className: `px-3 py-2 text-sm rounded-lg border transition-colors ${filterType === ut.key
238
+ ].map((s) => ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [s.icon, (0, jsx_runtime_1.jsx)("span", { className: "text-sm text-neutral-400", children: s.label })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-2xl font-bold text-white font-mono", children: summaryLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [fmt(s.value), s.suffix] }) })] }, s.label))) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors p-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col sm:flex-row gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "relative flex-1", children: [(0, jsx_runtime_1.jsx)(IconSearch, { className: "w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-neutral-500" }), (0, jsx_runtime_1.jsx)("input", { type: "text", placeholder: t('searchPlaceholder', 'Search territories...'), value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), className: "w-full pl-10 pr-3 py-2 bg-neutral-800 border border-neutral-700 rounded-lg text-white text-sm placeholder:text-neutral-500 outline-none focus:border-cyan-400/50 transition-colors" })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex gap-2 flex-wrap", children: UNIT_TYPE_LABELS.map((ut) => ((0, jsx_runtime_1.jsx)("button", { onClick: () => setFilterType(ut.key), className: `px-3 py-2 text-sm rounded-lg border transition-colors ${filterType === ut.key
237
239
  ? 'bg-cyan-700 text-white border-cyan-700'
238
- : 'bg-transparent border-neutral-700 text-neutral-400 hover:text-neutral-200 hover:border-neutral-500'}`, children: ut.label }, ut.key))) })] }) }), territoriesLoading ? ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: [...Array(6)].map((_, i) => (0, jsx_runtime_1.jsx)(Skeleton, { className: "h-72" }, i)) })) : filteredTerritories.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-12 text-center", children: [(0, jsx_runtime_1.jsx)(IconImage, { className: "w-12 h-12 mx-auto mb-4 text-neutral-600" }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400", children: "No territories found" }), searchTerm && ((0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-500 mt-1", children: "Try adjusting your search or filter criteria" }))] }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: filteredTerritories.map((unit) => ((0, jsx_runtime_1.jsx)(TerritoryCard, { unit: unit, onClick: () => setSelectedId(unit.unit_id) }, unit.unit_id))) }))] }));
240
+ : 'bg-transparent border-neutral-700 text-neutral-400 hover:text-neutral-200 hover:border-neutral-500'}`, children: ut.label }, ut.key))) })] }) }), territoriesLoading ? ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: [...Array(6)].map((_, i) => (0, jsx_runtime_1.jsx)(Skeleton, { className: "h-72" }, i)) })) : filteredTerritories.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-12 text-center", children: [(0, jsx_runtime_1.jsx)(IconImage, { className: "w-12 h-12 mx-auto mb-4 text-neutral-600" }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400", children: t('nftNotFound', 'No territories found') }), searchTerm && ((0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-500 mt-1", children: t('searchHint', 'Try adjusting your search or filter criteria') }))] }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: filteredTerritories.map((unit) => ((0, jsx_runtime_1.jsx)(TerritoryCard, { unit: unit, onClick: () => setSelectedId(unit.unit_id) }, unit.unit_id))) }))] }));
239
241
  }
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.MicrocosmVotingPage = MicrocosmVotingPage;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const i18n_context_1 = require("../../i18n-context");
6
7
  /* ── Inline SVG Icons (lucide style: 24x24, stroke 2, round caps) ── */
7
8
  const VoteIcon = ({ className }) => ((0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: className, children: [(0, jsx_runtime_1.jsx)("path", { d: "M20 11.08V8l-6-6H6a2 2 0 0 0-2 2v16c0 1.1.9 2 2 2h6" }), (0, jsx_runtime_1.jsx)("path", { d: "M14 2v6h6" }), (0, jsx_runtime_1.jsx)("path", { d: "M18 21l-3-3 3-3" }), (0, jsx_runtime_1.jsx)("path", { d: "M22 18h-6" })] }));
8
9
  const SwordsIcon = ({ className }) => ((0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: className, children: [(0, jsx_runtime_1.jsx)("polyline", { points: "14.5 17.5 3 6 3 3 6 3 17.5 14.5" }), (0, jsx_runtime_1.jsx)("line", { x1: "13", y1: "19", x2: "19", y2: "13" }), (0, jsx_runtime_1.jsx)("line", { x1: "16", y1: "16", x2: "20", y2: "20" }), (0, jsx_runtime_1.jsx)("line", { x1: "19", y1: "21", x2: "21", y2: "19" }), (0, jsx_runtime_1.jsx)("polyline", { points: "14.5 6.5 18 3 21 3 21 6 17.5 9.5" }), (0, jsx_runtime_1.jsx)("line", { x1: "5", y1: "14", x2: "9", y2: "18" }), (0, jsx_runtime_1.jsx)("line", { x1: "7", y1: "17", x2: "4", y2: "20" }), (0, jsx_runtime_1.jsx)("line", { x1: "3", y1: "19", x2: "5", y2: "21" })] }));
@@ -13,5 +14,6 @@ const ShieldIcon = ({ className }) => ((0, jsx_runtime_1.jsx)("svg", { xmlns: "h
13
14
  const UsersIcon = ({ className }) => ((0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: className, 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" })] }));
14
15
  const CoinsIcon = ({ className }) => ((0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: className, 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" }), (0, jsx_runtime_1.jsx)("path", { d: "m16.71 13.88.7.71-2.82 2.82" })] }));
15
16
  function MicrocosmVotingPage({ basePath = '', onNavigate }) {
16
- return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto p-6 space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-2xl font-bold text-white tracking-wider", children: "Community Voting" }), (0, jsx_runtime_1.jsxs)("span", { className: "inline-flex items-center bg-cyan-400/20 text-cyan-400 border border-cyan-400/30 text-xs px-2.5 py-0.5 rounded-full font-medium", children: [(0, jsx_runtime_1.jsx)(ConstructionIcon, { className: "w-3 h-3 mr-1" }), "Under Construction"] })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: "Token-driven community governance and decision-making mechanism" })] }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(TargetIcon, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: "Build Goal" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-neutral-300 text-sm leading-relaxed", children: "Microcosm community voting system uses a \"Capital Voting\" mechanism -- users vote with MCC Tokens, making every vote carry real economic weight." }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700 hover:border-cyan-400/50 transition-colors", children: [(0, jsx_runtime_1.jsx)(ShieldIcon, { className: "w-5 h-5 text-white mb-2" }), (0, jsx_runtime_1.jsx)("div", { className: "text-white text-sm font-medium mb-1", children: "Anti-Sybil Attack" }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs", children: "Voting requires real capital investment, effectively preventing ballot stuffing and fake votes" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700 hover:border-cyan-400/50 transition-colors", children: [(0, jsx_runtime_1.jsx)(CoinsIcon, { className: "w-5 h-5 text-white mb-2" }), (0, jsx_runtime_1.jsx)("div", { className: "text-white text-sm font-medium mb-1", children: "Economic Game Theory" }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs", children: "Voters bear economic consequences for their choices, promoting rational decision-making" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700 hover:border-cyan-400/50 transition-colors", children: [(0, jsx_runtime_1.jsx)(UsersIcon, { className: "w-5 h-5 text-white mb-2" }), (0, jsx_runtime_1.jsx)("div", { className: "text-white text-sm font-medium mb-1", children: "Community Self-governance" }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs", children: "Major decisions are made jointly by token-holding community, achieving decentralized governance" })] })] })] })] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 mb-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "p-2 rounded bg-neutral-800", children: (0, jsx_runtime_1.jsx)(SwordsIcon, { className: "w-5 h-5 text-white" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-medium", children: "Betting Mode Voting" }), (0, jsx_runtime_1.jsx)("span", { className: "inline-block bg-cyan-400/20 text-cyan-400 border border-cyan-400/30 text-xs px-2.5 py-0.5 rounded-full font-medium mt-1", children: "Betting Mode" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 text-sm leading-relaxed", children: "Voters invest MCC into their supported option. After voting ends, funds from the losing side are distributed equally among all voters on the winning side." }), (0, jsx_runtime_1.jsxs)("div", { className: "p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-2", children: "Mechanism" }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-1.5 text-xs text-neutral-400", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 mt-0.5", children: "1." }), (0, jsx_runtime_1.jsx)("span", { children: "Users vote for an option with MCC" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 mt-0.5", children: "2." }), (0, jsx_runtime_1.jsx)("span", { children: "After voting closes, results are tallied, the side with more votes wins" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 mt-0.5", children: "3." }), (0, jsx_runtime_1.jsx)("span", { children: "MCC from losing side distributed proportionally to winning voters" })] })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: "Use cases: Market predictions, community disputes, direction choices" })] })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 mb-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "p-2 rounded bg-neutral-800", children: (0, jsx_runtime_1.jsx)(HeartIcon, { className: "w-5 h-5 text-red-400" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-medium", children: "Public Welfare Voting" }), (0, jsx_runtime_1.jsx)("span", { className: "inline-block bg-white/20 text-white border border-white/30 text-xs px-2.5 py-0.5 rounded-full font-medium mt-1", children: "Public Welfare Mode" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 text-sm leading-relaxed", children: "Regardless of outcome, all MCC invested by voters goes to the foundation pool, funding third-party project development and ecosystem building." }), (0, jsx_runtime_1.jsxs)("div", { className: "p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-2", children: "Mechanism" }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-1.5 text-xs text-neutral-400", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 mt-0.5", children: "1." }), (0, jsx_runtime_1.jsx)("span", { children: "Users vote for an option with MCC" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 mt-0.5", children: "2." }), (0, jsx_runtime_1.jsx)("span", { children: "After voting closes, results are tallied, majority decision is executed" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 mt-0.5", children: "3." }), (0, jsx_runtime_1.jsx)("span", { children: "All voting funds (both sides) enter the foundation" })] })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: "Use cases: Public proposals, ecosystem fund allocation, project support decisions" })] })] }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(VoteIcon, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: "Voting Rules" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "voting_currency" }), (0, jsx_runtime_1.jsx)("div", { className: "text-white text-sm font-medium", children: "MCC (Microcosm Coin)" }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs mt-1", children: "Votes use MCC Token, invested funds are locked" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "vote_weight" }), (0, jsx_runtime_1.jsx)("div", { className: "text-white text-sm font-medium", children: "1 MCC = 1 Vote" }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs mt-1", children: "Voting weight proportional to invested amount" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "min_participation" }), (0, jsx_runtime_1.jsx)("div", { className: "text-white text-sm font-medium", children: "Miner Level or Above" }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs mt-1", children: "Must reach Miner rank to participate in voting" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "foundation_fund" }), (0, jsx_runtime_1.jsx)("div", { className: "text-white text-sm font-medium", children: "Support Third-party Projects" }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs mt-1", children: "Public welfare voting funds used for ecosystem building" })] })] })] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center py-8", children: [(0, jsx_runtime_1.jsx)(ConstructionIcon, { className: "w-10 h-10 text-neutral-700 mx-auto mb-3" }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 text-sm", children: "Community voting feature is under development, stay tuned" }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 text-xs mt-1", children: "Coming Soon" })] })] }));
17
+ const t = (0, i18n_context_1.useTranslations)('votingDash');
18
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto p-6 space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-2xl font-bold text-white tracking-wider", children: t('title', 'Community Voting') }), (0, jsx_runtime_1.jsxs)("span", { className: "inline-flex items-center bg-cyan-400/20 text-cyan-400 border border-cyan-400/30 text-xs px-2.5 py-0.5 rounded-full font-medium", children: [(0, jsx_runtime_1.jsx)(ConstructionIcon, { className: "w-3 h-3 mr-1" }), t('underConstruction', 'Under Construction')] })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('subtitle', 'Token-driven community governance and decision-making mechanism') })] }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(TargetIcon, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('buildGoal', 'Build Goal') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-neutral-300 text-sm leading-relaxed", children: t('buildDesc', 'Microcosm community voting system uses a "Capital Voting" mechanism -- users vote with MCC Tokens, making every vote carry real economic weight.') }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700 hover:border-cyan-400/50 transition-colors", children: [(0, jsx_runtime_1.jsx)(ShieldIcon, { className: "w-5 h-5 text-white mb-2" }), (0, jsx_runtime_1.jsx)("div", { className: "text-white text-sm font-medium mb-1", children: t('antiSybil', 'Anti-Sybil Attack') }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs", children: t('antiSybilDesc', 'Voting requires real capital investment, effectively preventing ballot stuffing and fake votes') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700 hover:border-cyan-400/50 transition-colors", children: [(0, jsx_runtime_1.jsx)(CoinsIcon, { className: "w-5 h-5 text-white mb-2" }), (0, jsx_runtime_1.jsx)("div", { className: "text-white text-sm font-medium mb-1", children: t('economicGame', 'Economic Game Theory') }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs", children: t('economicGameDesc', 'Voters bear economic consequences for their choices, promoting rational decision-making') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700 hover:border-cyan-400/50 transition-colors", children: [(0, jsx_runtime_1.jsx)(UsersIcon, { className: "w-5 h-5 text-white mb-2" }), (0, jsx_runtime_1.jsx)("div", { className: "text-white text-sm font-medium mb-1", children: t('communityGov', 'Community Governance') }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs", children: t('communityGovDesc', 'Major decisions are made jointly by token-holding community, achieving decentralized governance') })] })] })] })] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 mb-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "p-2 rounded bg-neutral-800", children: (0, jsx_runtime_1.jsx)(SwordsIcon, { className: "w-5 h-5 text-white" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-medium", children: t('bettingMode', 'Betting Mode Voting') }), (0, jsx_runtime_1.jsx)("span", { className: "inline-block bg-cyan-400/20 text-cyan-400 border border-cyan-400/30 text-xs px-2.5 py-0.5 rounded-full font-medium mt-1", children: t('bettingVote', 'Betting Vote') })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 text-sm leading-relaxed", children: t('bettingDesc', 'Voters invest MCC into their supported option. After voting ends, funds from the losing side are distributed equally among all voters on the winning side.') }), (0, jsx_runtime_1.jsxs)("div", { className: "p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-2", children: t('mechanismLabel', 'Mechanism') }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-1.5 text-xs text-neutral-400", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 mt-0.5", children: "1." }), (0, jsx_runtime_1.jsx)("span", { children: t('bettingStep1', 'Users vote for an option with MCC') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 mt-0.5", children: "2." }), (0, jsx_runtime_1.jsx)("span", { children: t('bettingStep2', 'After voting closes, results are tallied, the side with more votes wins') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 mt-0.5", children: "3." }), (0, jsx_runtime_1.jsx)("span", { children: t('bettingStep3', 'MCC from losing side distributed proportionally to winning voters') })] })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('bettingUseCase', 'Use cases: Market predictions, community disputes, direction choices') })] })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 mb-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "p-2 rounded bg-neutral-800", children: (0, jsx_runtime_1.jsx)(HeartIcon, { className: "w-5 h-5 text-red-400" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-medium", children: t('publicWelfareMode', 'Public Welfare Voting') }), (0, jsx_runtime_1.jsx)("span", { className: "inline-block bg-white/20 text-white border border-white/30 text-xs px-2.5 py-0.5 rounded-full font-medium mt-1", children: t('publicWelfareVote', 'Public Welfare Vote') })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 text-sm leading-relaxed", children: t('publicWelfareDesc', 'Regardless of outcome, all MCC invested by voters goes to the foundation pool, funding third-party project development and ecosystem building.') }), (0, jsx_runtime_1.jsxs)("div", { className: "p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-2", children: t('mechanismLabel', 'Mechanism') }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-1.5 text-xs text-neutral-400", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 mt-0.5", children: "1." }), (0, jsx_runtime_1.jsx)("span", { children: t('welfareStep1', 'Users vote with MCC on an option') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 mt-0.5", children: "2." }), (0, jsx_runtime_1.jsx)("span", { children: t('welfareStep2', 'Results tallied after deadline, majority decision executed') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 mt-0.5", children: "3." }), (0, jsx_runtime_1.jsx)("span", { children: t('welfareStep3', 'All voting funds (both sides) go to the foundation') })] })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('publicUseCase', 'Use cases: Public proposals, ecosystem fund allocation, project support decisions') })] })] }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(VoteIcon, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('votingRules', 'Voting Rules') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "voting_currency" }), (0, jsx_runtime_1.jsx)("div", { className: "text-white text-sm font-medium", children: t('votingCurrency', 'MCC (Microcosm Coin)') }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs mt-1", children: t('votingCurrencyDesc', 'Votes use MCC Token, invested funds are locked') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "vote_weight" }), (0, jsx_runtime_1.jsx)("div", { className: "text-white text-sm font-medium", children: t('voteWeight', '1 MCC = 1 Vote') }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs mt-1", children: t('voteWeightDesc', 'Voting weight proportional to invested amount') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "min_participation" }), (0, jsx_runtime_1.jsx)("div", { className: "text-white text-sm font-medium", children: t('minParticipation', 'Miner Level or Above') }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs mt-1", children: t('minParticipationDesc', 'Must reach Miner rank to participate in voting') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "foundation_fund" }), (0, jsx_runtime_1.jsx)("div", { className: "text-white text-sm font-medium", children: t('foundationFund', 'Support Third-party Projects') }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs mt-1", children: t('foundationFundDesc', 'Public welfare voting funds used for ecosystem building') })] })] })] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center py-8", children: [(0, jsx_runtime_1.jsx)(ConstructionIcon, { className: "w-10 h-10 text-neutral-700 mx-auto mb-3" }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 text-sm", children: t('comingSoon', 'Community voting feature is under development, stay tuned') }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 text-xs mt-1", children: "Coming Soon" })] })] }));
17
19
  }
@@ -6,6 +6,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const react_1 = require("react");
7
7
  const auth_react_1 = require("@microcosmmoney/auth-react");
8
8
  const mainstream_tokens_1 = require("../../config/mainstream-tokens");
9
+ const i18n_context_1 = require("../../i18n-context");
9
10
  /* ── helpers ── */
10
11
  const fmt = (n, d = 2) => n.toLocaleString('en-US', { minimumFractionDigits: d, maximumFractionDigits: d });
11
12
  const fmtUSD = (n) => '$' + n.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
@@ -77,16 +78,18 @@ function TokenIcon({ symbol, color, logoURI }) {
77
78
  return ((0, jsx_runtime_1.jsx)("div", { className: `w-10 h-10 rounded-full flex items-center justify-center text-white font-bold text-sm ${color}`, children: symbol.slice(0, 2) }));
78
79
  }
79
80
  function AssetList({ holdings, hideBalance, showWalletColumn, isLoading, }) {
81
+ const t = (0, i18n_context_1.useTranslations)('walletDash');
80
82
  if (isLoading) {
81
- return ((0, jsx_runtime_1.jsxs)("div", { className: "py-8 px-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center gap-3", children: [(0, jsx_runtime_1.jsx)(Spinner, { size: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 text-sm", children: "Syncing on-chain data..." })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-3 max-w-xs mx-auto", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-800 rounded-full h-1.5 overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-cyan-400/60 h-1.5 rounded-full animate-pulse", style: { width: '60%' } }) }) })] }));
83
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "py-8 px-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center gap-3", children: [(0, jsx_runtime_1.jsx)(Spinner, { size: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 text-sm", children: t('syncingOnChainData', 'Syncing on-chain data...') })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-3 max-w-xs mx-auto", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-800 rounded-full h-1.5 overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-cyan-400/60 h-1.5 rounded-full animate-pulse", style: { width: '60%' } }) }) })] }));
82
84
  }
83
85
  if (holdings.length === 0) {
84
- return ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-8 text-neutral-500", children: (0, jsx_runtime_1.jsx)("p", { className: "text-sm", children: "No valued assets found" }) }));
86
+ return ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-8 text-neutral-500", children: (0, jsx_runtime_1.jsx)("p", { className: "text-sm", children: t('noValuedAssets', 'No valued assets found') }) }));
85
87
  }
86
88
  const gridCols = showWalletColumn ? 'grid-cols-4' : 'grid-cols-3';
87
- return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: `gap-4 py-2 px-4 border-b border-neutral-700 text-xs font-medium text-neutral-400 tracking-wider grid ${gridCols}`, children: [(0, jsx_runtime_1.jsx)("div", { children: "Token" }), showWalletColumn && (0, jsx_runtime_1.jsx)("div", { children: "Wallet" }), (0, jsx_runtime_1.jsx)("div", { className: "text-right", children: "Amount" }), (0, jsx_runtime_1.jsx)("div", { className: "text-right", children: "Valuation" })] }), (0, jsx_runtime_1.jsx)("div", { className: "divide-y divide-neutral-800", children: holdings.map((h, idx) => ((0, jsx_runtime_1.jsxs)("div", { className: `gap-4 py-3 px-4 items-center hover:bg-neutral-700 transition-colors rounded grid ${gridCols}`, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(TokenIcon, { symbol: h.symbol, color: h.color, logoURI: h.logoURI }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-medium text-sm", children: h.symbol }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: h.name })] })] }), showWalletColumn && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("code", { className: "text-xs text-neutral-400 font-mono", children: h.walletShort }), h.isPrimary && (0, jsx_runtime_1.jsx)("span", { className: "ml-1 text-[10px] text-cyan-400", children: "Primary" })] })), (0, jsx_runtime_1.jsx)("div", { className: "text-right", children: (0, jsx_runtime_1.jsx)("div", { className: "text-white text-sm font-mono", children: hideBalance ? '****' : fmt(h.balance, h.balance < 1 ? 6 : 4) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-right", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-neutral-300 text-sm font-mono", children: hideBalance ? '****' : fmtUSD(h.usdValue) }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: fmtUSD(h.price) })] })] }, `${h.symbol}-${h.wallet || idx}`))) })] }));
89
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: `gap-4 py-2 px-4 border-b border-neutral-700 text-xs font-medium text-neutral-400 tracking-wider grid ${gridCols}`, children: [(0, jsx_runtime_1.jsx)("div", { children: t('token', 'Token') }), showWalletColumn && (0, jsx_runtime_1.jsx)("div", { children: t('wallet', 'Wallet') }), (0, jsx_runtime_1.jsx)("div", { className: "text-right", children: t('amount', 'Amount') }), (0, jsx_runtime_1.jsx)("div", { className: "text-right", children: t('valuation', 'Valuation') })] }), (0, jsx_runtime_1.jsx)("div", { className: "divide-y divide-neutral-800", children: holdings.map((h, idx) => ((0, jsx_runtime_1.jsxs)("div", { className: `gap-4 py-3 px-4 items-center hover:bg-neutral-700 transition-colors rounded grid ${gridCols}`, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(TokenIcon, { symbol: h.symbol, color: h.color, logoURI: h.logoURI }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-medium text-sm", children: h.symbol }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: h.name })] })] }), showWalletColumn && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("code", { className: "text-xs text-neutral-400 font-mono", children: h.walletShort }), h.isPrimary && (0, jsx_runtime_1.jsx)("span", { className: "ml-1 text-[10px] text-cyan-400", children: t('primary', 'Primary') })] })), (0, jsx_runtime_1.jsx)("div", { className: "text-right", children: (0, jsx_runtime_1.jsx)("div", { className: "text-white text-sm font-mono", children: hideBalance ? '****' : fmt(h.balance, h.balance < 1 ? 6 : 4) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-right", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-neutral-300 text-sm font-mono", children: hideBalance ? '****' : fmtUSD(h.usdValue) }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: fmtUSD(h.price) })] })] }, `${h.symbol}-${h.wallet || idx}`))) })] }));
88
90
  }
89
91
  function MicrocosmWalletPage({ basePath = '', onNavigate }) {
92
+ const t = (0, i18n_context_1.useTranslations)('walletDash');
90
93
  const { balance: mccData, price: mccPrice, loading: mccLoading, refresh: refreshMCC } = (0, auth_react_1.useMCC)(60000);
91
94
  const { balance: mcdData, loading: mcdLoading, refresh: refreshMCD } = (0, auth_react_1.useMCD)(60000);
92
95
  const { data: wallets, loading: walletsLoading } = (0, auth_react_1.useWallets)();
@@ -209,9 +212,9 @@ function MicrocosmWalletPage({ basePath = '', onNavigate }) {
209
212
  }
210
213
  };
211
214
  const anyError = false; // hooks don't expose combined error state cleanly
212
- return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto p-6 space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-2xl font-bold text-white tracking-wider", children: "Wallet" }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400 mt-1", children: "On-chain assets & balances" })] }), (0, jsx_runtime_1.jsxs)("button", { className: "flex items-center gap-2 px-3 py-1.5 text-sm border border-neutral-700 rounded text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent transition-colors disabled:opacity-50", onClick: handleRefresh, disabled: isRefreshing || multiLoading, children: [(0, jsx_runtime_1.jsx)(IconRefresh, { className: isRefreshing || multiLoading ? 'animate-spin' : '' }), "Refresh"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-between mb-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm", children: [(0, jsx_runtime_1.jsx)(IconWallet, { className: "text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { children: isAllTab ? 'Total Asset Value' : 'Wallet Asset Value' }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setHideBalance(!hideBalance), className: "hover:text-white transition-colors", children: hideBalance ? (0, jsx_runtime_1.jsx)(IconEyeOff, {}) : (0, jsx_runtime_1.jsx)(IconEye, {}) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-baseline gap-2 mb-1", children: (0, jsx_runtime_1.jsx)("span", { className: "text-3xl font-bold text-white font-mono", children: hideBalance ? '****' : (activeUsdValue > 0 ? fmtUSD(activeUsdValue) : '--') }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs", children: hideBalance ? '****' : 'Aggregated from on-chain token balances' })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [walletList.length > 1 && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 mb-4 overflow-x-auto pb-1", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => setActiveTab('all'), className: `px-3 py-1.5 text-xs rounded whitespace-nowrap transition-colors ${activeTab === 'all'
215
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto p-6 space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-2xl font-bold text-white tracking-wider", children: t('title', 'Wallet') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400 mt-1", children: t('subtitle', 'On-chain assets & balances') })] }), (0, jsx_runtime_1.jsxs)("button", { className: "flex items-center gap-2 px-3 py-1.5 text-sm border border-neutral-700 rounded text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent transition-colors disabled:opacity-50", onClick: handleRefresh, disabled: isRefreshing || multiLoading, children: [(0, jsx_runtime_1.jsx)(IconRefresh, { className: isRefreshing || multiLoading ? 'animate-spin' : '' }), t('refresh', 'Refresh')] })] }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-between mb-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm", children: [(0, jsx_runtime_1.jsx)(IconWallet, { className: "text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { children: isAllTab ? t('totalAssetValue', 'Total Asset Value') : t('walletAssetValue', 'Wallet Asset Value') }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setHideBalance(!hideBalance), className: "hover:text-white transition-colors", children: hideBalance ? (0, jsx_runtime_1.jsx)(IconEyeOff, {}) : (0, jsx_runtime_1.jsx)(IconEye, {}) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-baseline gap-2 mb-1", children: (0, jsx_runtime_1.jsx)("span", { className: "text-3xl font-bold text-white font-mono", children: hideBalance ? '****' : (activeUsdValue > 0 ? fmtUSD(activeUsdValue) : '--') }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs", children: hideBalance ? '****' : t('aggregatedDesc', 'Aggregated from on-chain token balances') })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [walletList.length > 1 && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 mb-4 overflow-x-auto pb-1", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => setActiveTab('all'), className: `px-3 py-1.5 text-xs rounded whitespace-nowrap transition-colors ${activeTab === 'all'
213
216
  ? 'bg-cyan-700 text-white'
214
- : 'bg-neutral-800 text-neutral-400 hover:text-white hover:bg-neutral-700'}`, children: ["Overview (", walletList.length, " wallets)"] }), walletList.map((w) => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => setActiveTab(w.wallet_address), className: `px-3 py-1.5 text-xs rounded whitespace-nowrap transition-colors flex items-center gap-1 ${activeTab === w.wallet_address
217
+ : 'bg-neutral-800 text-neutral-400 hover:text-white hover:bg-neutral-700'}`, children: [t('overview', 'Overview'), " (", walletList.length, " ", t('wallets', 'wallets'), ")"] }), walletList.map((w) => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => setActiveTab(w.wallet_address), className: `px-3 py-1.5 text-xs rounded whitespace-nowrap transition-colors flex items-center gap-1 ${activeTab === w.wallet_address
215
218
  ? 'bg-cyan-700 text-white'
216
- : 'bg-neutral-800 text-neutral-400 hover:text-white hover:bg-neutral-700'}`, children: [(0, jsx_runtime_1.jsxs)("code", { className: "font-mono", children: [w.wallet_address.slice(0, 4), "...", w.wallet_address.slice(-4)] }), w.is_primary && (0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400 text-[10px]", children: "Primary" })] }, w.wallet_address)))] })), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(IconCreditCard, { className: "text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: "On-Chain Assets" }), multiLoading && (0, jsx_runtime_1.jsx)(Spinner, { size: "w-3 h-3" })] }), multiLoading ? ((0, jsx_runtime_1.jsx)("div", { className: "py-10", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center gap-3", children: [(0, jsx_runtime_1.jsx)(Spinner, { size: "w-6 h-6" }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: "Syncing on-chain data..." }), (0, jsx_runtime_1.jsx)("div", { className: "w-48 h-1 bg-neutral-800 rounded-full overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "h-full bg-cyan-400/60 rounded-full animate-pulse", style: { width: '60%' } }) })] }) })) : ((0, jsx_runtime_1.jsx)(AssetList, { holdings: activeHoldings, hideBalance: hideBalance, showWalletColumn: showWalletCol, isLoading: multiLoading })), (0, jsx_runtime_1.jsx)("div", { className: "mt-4 pt-3 border-t border-neutral-700 space-y-2", children: isAllTab ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2 text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(IconInfo, { className: "mt-0.5 shrink-0" }), (0, jsx_runtime_1.jsxs)("span", { children: ["Aggregated on-chain balances across ", walletList.length, " wallet", walletList.length !== 1 ? 's' : '', ". Low-value assets (<$1) are hidden."] })] })) : ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(IconInfo, { className: "shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: "Current wallet:" }), (0, jsx_runtime_1.jsx)("code", { className: "text-neutral-400 bg-neutral-800 px-2 py-0.5 rounded font-mono", children: activeTab }), walletList.find((w) => w.wallet_address === activeTab)?.is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400 bg-cyan-400/20 px-1.5 py-0.5 rounded text-[10px]", children: "Primary" }))] }), (0, jsx_runtime_1.jsxs)("a", { href: `https://solscan.io/account/${activeTab}`, target: "_blank", rel: "noopener noreferrer", className: "text-cyan-400 hover:text-cyan-300 text-xs flex items-center gap-1", children: ["View on Solscan ", (0, jsx_runtime_1.jsx)(IconExternalLink, { className: "w-3 h-3" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2 text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(IconInfo, { className: "mt-0.5 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: "Showing on-chain balances for this wallet only. Low-value assets (<$1) are hidden." })] })] })) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "p-4 bg-cyan-400/20 rounded-xl border border-cyan-400/30", children: (0, jsx_runtime_1.jsx)(IconWallet, { className: "w-8 h-8 text-cyan-400" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "MCC Balance" }), (0, jsx_runtime_1.jsx)("div", { className: "text-4xl font-bold text-white font-mono", children: mccLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : mask(fmt(mccBalance)) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-sm text-neutral-500 mt-1", children: [mccLoading ? '' : mask(`${fmtUSD(totalUsd)}`), !mccLoading && price > 0 && ((0, jsx_runtime_1.jsxs)("span", { className: "ml-2 text-xs text-neutral-600", children: ["@ ", fmtUSD(price), "/MCC"] }))] })] })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => onNavigate?.(resolvePath('/mcc/mining')), className: "flex items-center gap-2 px-4 py-2 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-sm transition-colors", children: [(0, jsx_runtime_1.jsx)(IconExternalLink, { className: "h-4 w-4" }), "Mining Records"] })] }), walletList.length > 1 && mccData?.wallets && mccData.wallets.length > 1 && ((0, jsx_runtime_1.jsx)("div", { className: "mt-4 space-y-2", children: mccData.wallets.map((wb) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between p-3 bg-neutral-800 rounded border border-neutral-700 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-400 font-mono", children: [wb.wallet_address.slice(0, 6), "...", wb.wallet_address.slice(-4)] }), wb.is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "text-[10px] bg-cyan-400/20 text-cyan-400 px-1.5 py-0.5 rounded", children: "PRIMARY" }))] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-cyan-400 font-mono font-bold", children: [mask(fmt(wb.balance ?? 0, 3)), " MCC"] })] }, wb.wallet_address))) }))] }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(IconGift, { className: "text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: "MCD Points" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [(0, jsx_runtime_1.jsx)(IconCreditCard, { className: "h-4 w-4 text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400 tracking-wider", children: "Current Balance" })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-cyan-400 font-mono", children: mcdLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : mask(fmt(mcdAmount, 6)) }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500 mt-1", children: "MCD" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [(0, jsx_runtime_1.jsx)(IconTrendingUp, { className: "h-4 w-4 text-neutral-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400 tracking-wider", children: "Total Received" })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-white font-mono", children: mcdLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : mask(fmt(mcdTotalReceived, 6)) }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500 mt-1", children: "MCD" })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-4 pt-3 border-t border-neutral-700 space-y-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2 text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(IconGift, { className: "w-3 h-3 mt-0.5 shrink-0" }), (0, jsx_runtime_1.jsxs)("span", { children: ["Income: ", (0, jsx_runtime_1.jsx)("span", { className: "text-white", children: mask(fmt(mcdTotalReceived, 0)) }), ' · ', "Spent: ", (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: mask(fmt(mcdSpent, 0)) }), ' · ', "MCD is distributed daily to eligible miners."] })] }) })] }) }), activeLocks.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(IconLock, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: "Lock Period (14 days)" })] }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-3", children: activeLocks.map((lock) => ((0, jsx_runtime_1.jsx)(LockPeriodCard, { lock: lock, hideBalance: hideBalance }, lock.lock_id))) }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-3 text-xs text-neutral-500 font-mono", children: ["Total locked: ", mask(fmt(lockedAmount, 2)), " MCC"] })] }) })), walletList.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(IconWallet, { className: "w-4 h-4 text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: "Connected Wallets" })] }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-2", children: walletList.map((w) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("code", { className: "text-sm text-neutral-300 font-mono", children: w.wallet_address }), w.is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "text-[10px] bg-cyan-400/20 text-cyan-400 border border-cyan-400/30 px-1.5 py-0.5 rounded font-mono", children: "PRIMARY" }))] }), (0, jsx_runtime_1.jsx)("a", { href: `https://solscan.io/account/${w.wallet_address}`, target: "_blank", rel: "noopener noreferrer", className: "text-cyan-400 hover:text-cyan-300 transition-colors", children: (0, jsx_runtime_1.jsx)(IconExternalLink, { className: "w-4 h-4" }) })] }, w.wallet_address))) })] }) }))] }));
219
+ : 'bg-neutral-800 text-neutral-400 hover:text-white hover:bg-neutral-700'}`, children: [(0, jsx_runtime_1.jsxs)("code", { className: "font-mono", children: [w.wallet_address.slice(0, 4), "...", w.wallet_address.slice(-4)] }), w.is_primary && (0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400 text-[10px]", children: t('primary', 'Primary') })] }, w.wallet_address)))] })), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(IconCreditCard, { className: "text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('onChainAssets', 'On-Chain Assets') }), multiLoading && (0, jsx_runtime_1.jsx)(Spinner, { size: "w-3 h-3" })] }), multiLoading ? ((0, jsx_runtime_1.jsx)("div", { className: "py-10", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center gap-3", children: [(0, jsx_runtime_1.jsx)(Spinner, { size: "w-6 h-6" }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('syncingOnChainData', 'Syncing on-chain data...') }), (0, jsx_runtime_1.jsx)("div", { className: "w-48 h-1 bg-neutral-800 rounded-full overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "h-full bg-cyan-400/60 rounded-full animate-pulse", style: { width: '60%' } }) })] }) })) : ((0, jsx_runtime_1.jsx)(AssetList, { holdings: activeHoldings, hideBalance: hideBalance, showWalletColumn: showWalletCol, isLoading: multiLoading })), (0, jsx_runtime_1.jsx)("div", { className: "mt-4 pt-3 border-t border-neutral-700 space-y-2", children: isAllTab ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2 text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(IconInfo, { className: "mt-0.5 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('allWalletsNote', 'Aggregated on-chain balances across {count} wallets. Low-value assets (<$1) are hidden.', { count: walletList.length }) })] })) : ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(IconInfo, { className: "shrink-0" }), (0, jsx_runtime_1.jsxs)("span", { children: [t('currentWallet', 'Current wallet'), ":"] }), (0, jsx_runtime_1.jsx)("code", { className: "text-neutral-400 bg-neutral-800 px-2 py-0.5 rounded font-mono", children: activeTab }), walletList.find((w) => w.wallet_address === activeTab)?.is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400 bg-cyan-400/20 px-1.5 py-0.5 rounded text-[10px]", children: t('primary', 'Primary') }))] }), (0, jsx_runtime_1.jsxs)("a", { href: `https://solscan.io/account/${activeTab}`, target: "_blank", rel: "noopener noreferrer", className: "text-cyan-400 hover:text-cyan-300 text-xs flex items-center gap-1", children: [t('viewOnSolscan', 'View on Solscan'), " ", (0, jsx_runtime_1.jsx)(IconExternalLink, { className: "w-3 h-3" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2 text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(IconInfo, { className: "mt-0.5 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('singleWalletNote', 'Showing on-chain balances for this wallet only. Low-value assets (<$1) are hidden.') })] })] })) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "p-4 bg-cyan-400/20 rounded-xl border border-cyan-400/30", children: (0, jsx_runtime_1.jsx)(IconWallet, { className: "w-8 h-8 text-cyan-400" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t('mccBalance', 'MCC Balance') }), (0, jsx_runtime_1.jsx)("div", { className: "text-4xl font-bold text-white font-mono", children: mccLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : mask(fmt(mccBalance)) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-sm text-neutral-500 mt-1", children: [mccLoading ? '' : mask(`${fmtUSD(totalUsd)}`), !mccLoading && price > 0 && ((0, jsx_runtime_1.jsxs)("span", { className: "ml-2 text-xs text-neutral-600", children: ["@ ", fmtUSD(price), "/MCC"] }))] })] })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => onNavigate?.(resolvePath('/mcc/mining')), className: "flex items-center gap-2 px-4 py-2 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-sm transition-colors", children: [(0, jsx_runtime_1.jsx)(IconExternalLink, { className: "h-4 w-4" }), t('mintRecords', 'Mining Records')] })] }), walletList.length > 1 && mccData?.wallets && mccData.wallets.length > 1 && ((0, jsx_runtime_1.jsx)("div", { className: "mt-4 space-y-2", children: mccData.wallets.map((wb) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between p-3 bg-neutral-800 rounded border border-neutral-700 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-400 font-mono", children: [wb.wallet_address.slice(0, 6), "...", wb.wallet_address.slice(-4)] }), wb.is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "text-[10px] bg-cyan-400/20 text-cyan-400 px-1.5 py-0.5 rounded", children: "PRIMARY" }))] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-cyan-400 font-mono font-bold", children: [mask(fmt(wb.balance ?? 0, 3)), " MCC"] })] }, wb.wallet_address))) }))] }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(IconGift, { className: "text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('mcdPoints', 'MCD Points') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [(0, jsx_runtime_1.jsx)(IconCreditCard, { className: "h-4 w-4 text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400 tracking-wider", children: t('currentBalance', 'Current Balance') })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-cyan-400 font-mono", children: mcdLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : mask(fmt(mcdAmount, 6)) }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500 mt-1", children: "MCD" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [(0, jsx_runtime_1.jsx)(IconTrendingUp, { className: "h-4 w-4 text-neutral-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400 tracking-wider", children: t('totalReceived', 'Total Received') })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-white font-mono", children: mcdLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : mask(fmt(mcdTotalReceived, 6)) }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500 mt-1", children: "MCD" })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-4 pt-3 border-t border-neutral-700 space-y-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2 text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(IconGift, { className: "w-3 h-3 mt-0.5 shrink-0" }), (0, jsx_runtime_1.jsxs)("span", { children: [t('income', 'Income'), ": ", (0, jsx_runtime_1.jsx)("span", { className: "text-white", children: mask(fmt(mcdTotalReceived, 0)) }), ' · ', t('spent', 'Spent'), ": ", (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: mask(fmt(mcdSpent, 0)) }), ' · ', t('mcdDistributionNote', 'MCD is distributed daily to eligible miners.')] })] }) })] }) }), activeLocks.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(IconLock, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('lockPeriod14Days', 'Lock Period (14 days)') })] }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-3", children: activeLocks.map((lock) => ((0, jsx_runtime_1.jsx)(LockPeriodCard, { lock: lock, hideBalance: hideBalance }, lock.lock_id))) }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-3 text-xs text-neutral-500 font-mono", children: [t('totalLocked', 'Total locked'), ": ", mask(fmt(lockedAmount, 2)), " MCC"] })] }) })), walletList.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(IconWallet, { className: "w-4 h-4 text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('connectedWallets', 'Connected Wallets') })] }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-2", children: walletList.map((w) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("code", { className: "text-sm text-neutral-300 font-mono", children: w.wallet_address }), w.is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "text-[10px] bg-cyan-400/20 text-cyan-400 border border-cyan-400/30 px-1.5 py-0.5 rounded font-mono", children: "PRIMARY" }))] }), (0, jsx_runtime_1.jsx)("a", { href: `https://solscan.io/account/${w.wallet_address}`, target: "_blank", rel: "noopener noreferrer", className: "text-cyan-400 hover:text-cyan-300 transition-colors", children: (0, jsx_runtime_1.jsx)(IconExternalLink, { className: "w-4 h-4" }) })] }, w.wallet_address))) })] }) }))] }));
217
220
  }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ type Messages = Record<string, any>;
3
+ export interface MicrocosmI18nProviderProps {
4
+ messages?: Messages;
5
+ children: React.ReactNode;
6
+ }
7
+ export declare function MicrocosmI18nProvider({ messages, children }: MicrocosmI18nProviderProps): import("react/jsx-runtime").JSX.Element;
8
+ export type TranslateFn = (key: string, fallbackOrValues?: string | Record<string, any>, values?: Record<string, any>) => string;
9
+ export declare function useTranslations(namespace?: string): TranslateFn;
10
+ export declare function useT(): TranslateFn;
11
+ export {};
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.MicrocosmI18nProvider = MicrocosmI18nProvider;
5
+ exports.useTranslations = useTranslations;
6
+ exports.useT = useT;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("react");
9
+ const I18nContext = (0, react_1.createContext)({});
10
+ function MicrocosmI18nProvider({ messages, children }) {
11
+ const value = (0, react_1.useMemo)(() => messages || {}, [messages]);
12
+ return (0, jsx_runtime_1.jsx)(I18nContext.Provider, { value: value, children: children });
13
+ }
14
+ function resolvePath(messages, key) {
15
+ const parts = key.split('.');
16
+ let v = messages;
17
+ for (const p of parts) {
18
+ if (v == null)
19
+ return undefined;
20
+ v = v[p];
21
+ }
22
+ return v;
23
+ }
24
+ function interpolate(template, values) {
25
+ if (!values)
26
+ return template;
27
+ return template.replace(/\{(\w+)\}/g, (_, k) => {
28
+ const v = values[k];
29
+ return v != null ? String(v) : `{${k}}`;
30
+ });
31
+ }
32
+ function useTranslations(namespace) {
33
+ const messages = (0, react_1.useContext)(I18nContext);
34
+ return (0, react_1.useMemo)(() => {
35
+ return (key, fallbackOrValues, values) => {
36
+ const fullKey = namespace ? `${namespace}.${key}` : key;
37
+ const raw = resolvePath(messages, fullKey);
38
+ let fallback;
39
+ let interpValues;
40
+ if (typeof fallbackOrValues === 'string') {
41
+ fallback = fallbackOrValues;
42
+ interpValues = values;
43
+ }
44
+ else if (fallbackOrValues && typeof fallbackOrValues === 'object') {
45
+ interpValues = fallbackOrValues;
46
+ }
47
+ if (typeof raw === 'string') {
48
+ return interpolate(raw, interpValues);
49
+ }
50
+ if (fallback) {
51
+ return interpolate(fallback, interpValues);
52
+ }
53
+ return key;
54
+ };
55
+ }, [messages, namespace]);
56
+ }
57
+ function useT() {
58
+ return useTranslations();
59
+ }
package/dist/index.d.ts CHANGED
@@ -2,6 +2,8 @@ export { MicrocosmMenuSection } from './components/menu-section';
2
2
  export type { MicrocosmMenuSectionProps } from './components/menu-section';
3
3
  export { LinkProvider, useLinkComponent } from './link-context';
4
4
  export type { LinkProps, LinkComponent } from './link-context';
5
+ export { MicrocosmI18nProvider, useTranslations, useT } from './i18n-context';
6
+ export type { MicrocosmI18nProviderProps, TranslateFn } from './i18n-context';
5
7
  export { blockchainMenu, web3OsMenu, dashboardMenu, microcosmMenuGroups, getAllMenuItems, resolveMenuPath, getMenuTitle, getMenuDescription, } from './menu-config';
6
8
  export type { MicrocosmMenuItem, MicrocosmMenuGroup, MenuLocale } from './menu-config';
7
9
  export { TerminalCard, StatBox, TerminalCommand, TerminalPageHeader, TerminalLoading, TerminalError, TerminalEmpty, TerminalBadge, TerminalDataRow, TerminalProgress, } from './components/terminal';
package/dist/index.js CHANGED
@@ -1,12 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MicrocosmTerritoryPage = exports.MicrocosmAuctionPage = exports.MicrocosmMCDPage = exports.MicrocosmMiningPage = exports.MicrocosmWalletPage = exports.MicrocosmLendingPage = exports.MicrocosmFragmentPage = exports.MicrocosmLockPeriods = exports.MicrocosmMCDStats = exports.MicrocosmMCCTokenStats = exports.MicrocosmEcosystemStats = exports.MicrocosmMyMining = exports.MicrocosmMiningWeight = exports.MicrocosmMintingStats = exports.MicrocosmPriceChart = exports.MicrocosmAssetsSummary = exports.MicrocosmQuickActions = exports.MicrocosmMarketBar = exports.MicrocosmDashboardOverview = exports.KPIRadialChart = exports.VoteResultBar = exports.MiningProgressBar = exports.TerritoryCard = exports.TerminalTooltip = exports.TerminalInput = exports.TerminalCountdown = exports.TerminalDialog = exports.TerminalTabs = exports.TerminalTable = exports.TerminalProgress = exports.TerminalDataRow = exports.TerminalBadge = exports.TerminalEmpty = exports.TerminalError = exports.TerminalLoading = exports.TerminalPageHeader = exports.TerminalCommand = exports.StatBox = exports.TerminalCard = exports.getMenuDescription = exports.getMenuTitle = exports.resolveMenuPath = exports.getAllMenuItems = exports.microcosmMenuGroups = exports.dashboardMenu = exports.web3OsMenu = exports.blockchainMenu = exports.useLinkComponent = exports.LinkProvider = exports.MicrocosmMenuSection = void 0;
4
- exports.MicrocosmTwoFactorSettings = exports.MicrocosmEmailChangeCard = exports.MicrocosmProfilePage = exports.MicrocosmRewardsPage = exports.MicrocosmStationListPage = exports.MicrocosmQueueStatusPage = exports.MicrocosmManagerIncomePage = exports.MicrocosmReincarnationPage = exports.MicrocosmVotingPage = exports.MicrocosmOrganizationPage = void 0;
3
+ exports.MicrocosmMiningPage = exports.MicrocosmWalletPage = exports.MicrocosmLendingPage = exports.MicrocosmFragmentPage = exports.MicrocosmLockPeriods = exports.MicrocosmMCDStats = exports.MicrocosmMCCTokenStats = exports.MicrocosmEcosystemStats = exports.MicrocosmMyMining = exports.MicrocosmMiningWeight = exports.MicrocosmMintingStats = exports.MicrocosmPriceChart = exports.MicrocosmAssetsSummary = exports.MicrocosmQuickActions = exports.MicrocosmMarketBar = exports.MicrocosmDashboardOverview = exports.KPIRadialChart = exports.VoteResultBar = exports.MiningProgressBar = exports.TerritoryCard = exports.TerminalTooltip = exports.TerminalInput = exports.TerminalCountdown = exports.TerminalDialog = exports.TerminalTabs = exports.TerminalTable = exports.TerminalProgress = exports.TerminalDataRow = exports.TerminalBadge = exports.TerminalEmpty = exports.TerminalError = exports.TerminalLoading = exports.TerminalPageHeader = exports.TerminalCommand = exports.StatBox = exports.TerminalCard = exports.getMenuDescription = exports.getMenuTitle = exports.resolveMenuPath = exports.getAllMenuItems = exports.microcosmMenuGroups = exports.dashboardMenu = exports.web3OsMenu = exports.blockchainMenu = exports.useT = exports.useTranslations = exports.MicrocosmI18nProvider = exports.useLinkComponent = exports.LinkProvider = exports.MicrocosmMenuSection = void 0;
4
+ exports.MicrocosmTwoFactorSettings = exports.MicrocosmEmailChangeCard = exports.MicrocosmProfilePage = exports.MicrocosmRewardsPage = exports.MicrocosmStationListPage = exports.MicrocosmQueueStatusPage = exports.MicrocosmManagerIncomePage = exports.MicrocosmReincarnationPage = exports.MicrocosmVotingPage = exports.MicrocosmOrganizationPage = exports.MicrocosmTerritoryPage = exports.MicrocosmAuctionPage = exports.MicrocosmMCDPage = void 0;
5
5
  var menu_section_1 = require("./components/menu-section");
6
6
  Object.defineProperty(exports, "MicrocosmMenuSection", { enumerable: true, get: function () { return menu_section_1.MicrocosmMenuSection; } });
7
7
  var link_context_1 = require("./link-context");
8
8
  Object.defineProperty(exports, "LinkProvider", { enumerable: true, get: function () { return link_context_1.LinkProvider; } });
9
9
  Object.defineProperty(exports, "useLinkComponent", { enumerable: true, get: function () { return link_context_1.useLinkComponent; } });
10
+ var i18n_context_1 = require("./i18n-context");
11
+ Object.defineProperty(exports, "MicrocosmI18nProvider", { enumerable: true, get: function () { return i18n_context_1.MicrocosmI18nProvider; } });
12
+ Object.defineProperty(exports, "useTranslations", { enumerable: true, get: function () { return i18n_context_1.useTranslations; } });
13
+ Object.defineProperty(exports, "useT", { enumerable: true, get: function () { return i18n_context_1.useT; } });
10
14
  var menu_config_1 = require("./menu-config");
11
15
  Object.defineProperty(exports, "blockchainMenu", { enumerable: true, get: function () { return menu_config_1.blockchainMenu; } });
12
16
  Object.defineProperty(exports, "web3OsMenu", { enumerable: true, get: function () { return menu_config_1.web3OsMenu; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microcosmmoney/portal-react",
3
- "version": "3.10.0",
3
+ "version": "3.11.0",
4
4
  "description": "Microcosm Portal UI components for React/Next.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",