@microcosmmoney/portal-react 3.12.3 → 3.12.5
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/auction/auction-page.js +9 -9
- package/dist/components/dashboard/assets-summary.js +2 -2
- package/dist/components/dashboard/dashboard-overview.js +1 -1
- package/dist/components/dashboard/ecosystem-stats.js +2 -2
- package/dist/components/dashboard/lock-periods.js +1 -1
- package/dist/components/dashboard/market-overview-bar.js +3 -3
- package/dist/components/dashboard/mcc-token-stats.js +1 -1
- package/dist/components/dashboard/mcd-stats.js +1 -1
- package/dist/components/dashboard/mining-weight.js +1 -1
- package/dist/components/dashboard/minting-stats.js +2 -2
- package/dist/components/dashboard/my-mining.js +1 -1
- package/dist/components/dashboard/price-chart.js +3 -3
- package/dist/components/dashboard/quick-actions.js +2 -2
- package/dist/components/fragment/fragment-page.js +1 -1
- package/dist/components/income/manager-income-page.js +3 -3
- package/dist/components/lending/lending-page.js +1 -1
- package/dist/components/mcd/mcd-page.js +8 -8
- package/dist/components/mining/mining-page.js +2 -2
- package/dist/components/organization/organization-page.js +18 -18
- package/dist/components/profile/email-change-card.js +2 -2
- package/dist/components/profile/profile-page.js +3 -3
- package/dist/components/profile/two-factor-settings.js +1 -1
- package/dist/components/queue/queue-status-page.js +2 -2
- package/dist/components/reincarnation/reincarnation-page.js +1 -1
- package/dist/components/rewards/rewards-page.js +1 -1
- package/dist/components/stations/station-list-page.js +2 -2
- package/dist/components/territory/territory-page.js +18 -18
- package/dist/components/voting/voting-page.js +1 -1
- package/dist/components/wallet/wallet-page.js +8 -8
- package/package.json +1 -1
|
@@ -37,11 +37,11 @@ function FlipCard({ front, back }) {
|
|
|
37
37
|
}, children: [(0, jsx_runtime_1.jsx)("div", { className: "group relative overflow-hidden rounded-lg border border-neutral-700 bg-neutral-900 hover:border-cyan-400/50 transition-colors", style: {
|
|
38
38
|
backfaceVisibility: 'hidden',
|
|
39
39
|
display: isFlipped ? 'none' : undefined,
|
|
40
|
-
}, children: (0, jsx_runtime_1.jsx)("div", { className: "relative z-10 p-6", children: front }) }), (0, jsx_runtime_1.jsx)("div", { className: "overflow-hidden rounded-lg border border-cyan-400/30 bg-neutral-900", style: {
|
|
40
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { className: "relative z-10 p-2 2xs:p-3 sm:p-4 md:p-6", children: front }) }), (0, jsx_runtime_1.jsx)("div", { className: "overflow-hidden rounded-lg border border-cyan-400/30 bg-neutral-900", style: {
|
|
41
41
|
backfaceVisibility: 'hidden',
|
|
42
42
|
transform: 'rotateY(180deg)',
|
|
43
43
|
display: isFlipped ? undefined : 'none',
|
|
44
|
-
}, children: (0, jsx_runtime_1.jsx)("div", { className: "relative z-10 p-6", children: back }) })] }) }));
|
|
44
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { className: "relative z-10 p-2 2xs:p-3 sm:p-4 md:p-6", children: back }) })] }) }));
|
|
45
45
|
}
|
|
46
46
|
function MicrocosmOrganizationPage({ basePath = '', onNavigate }) {
|
|
47
47
|
const { data: summary, loading: summaryLoading } = (0, auth_react_1.useOrganizationSummary)();
|
|
@@ -60,34 +60,34 @@ function MicrocosmOrganizationPage({ basePath = '', onNavigate }) {
|
|
|
60
60
|
const systemCount = org?.total_systems ?? 0;
|
|
61
61
|
const totalVaultMCD = org?.total_vault_mcd ?? 0;
|
|
62
62
|
if (loading) {
|
|
63
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-
|
|
63
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-2 py-3 space-y-2 2xs:px-3 2xs:py-4 2xs:space-y-3 sm:px-6 sm:py-6 sm:space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-base 2xs:text-lg xs:text-xl sm:text-2xl md:text-3xl font-bold text-white tracking-wider truncate", children: "Organization" }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-400 mt-1", children: "Ecosystem structure & territory management" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center py-20", children: [(0, jsx_runtime_1.jsx)(Spinner, {}), (0, jsx_runtime_1.jsx)("span", { className: "ml-3 text-neutral-400 text-xs 2xs:text-sm", children: "Loading organization data..." })] })] }));
|
|
64
64
|
}
|
|
65
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-
|
|
66
|
-
{ label: 'Total Users', value: totalUsers, icon: (0, jsx_runtime_1.jsx)(IconUsers, { size:
|
|
67
|
-
{ label: 'Miner', value: miners, icon: (0, jsx_runtime_1.jsx)(IconPickaxe, { size:
|
|
68
|
-
{ label: 'Commander', value: commanders, icon: (0, jsx_runtime_1.jsx)(IconUserCheck, { size:
|
|
69
|
-
{ label: 'Pioneer', value: pioneers, icon: (0, jsx_runtime_1.jsx)(IconCompass, { size:
|
|
70
|
-
{ label: 'Unassigned', value: unassigned, icon: (0, jsx_runtime_1.jsx)(IconUserX, { size:
|
|
71
|
-
].map(({ label, value, icon }) => ((0, jsx_runtime_1.jsxs)("div", { className: "p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 mb-1", children: [icon, (0, jsx_runtime_1.jsx)("span", { className: "text-xs text-cyan-400/70 tracking-wider", children: label })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg font-bold text-white font-mono", children: fmt(value) })] }, label))) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-2 sm:gap-3 md:gap-4", children: [(0, jsx_runtime_1.jsx)(FlipCard, { front: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "mb-4 flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(IconNetwork, { size:
|
|
72
|
-
{ label: 'Station', count: stationCount, icon: (0, jsx_runtime_1.jsx)(IconBuilding, { size:
|
|
73
|
-
{ label: 'Matrix', count: matrixCount, icon: (0, jsx_runtime_1.jsx)(IconGrid, { size:
|
|
74
|
-
{ label: 'Sector', count: sectorCount, icon: (0, jsx_runtime_1.jsx)(IconMap, { size:
|
|
75
|
-
{ label: 'System', count: systemCount, icon: (0, jsx_runtime_1.jsx)(IconGlobe, { size:
|
|
76
|
-
].map(({ label, count, icon }) => ((0, jsx_runtime_1.jsxs)("div", { className: "text-center p-3 bg-neutral-800 rounded border border-neutral-700", children: [icon, (0, jsx_runtime_1.jsx)("div", { className: "text-lg font-bold text-white font-mono", children: count }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-cyan-400/70 tracking-wider", children: label })] }, label))) }), (0, jsx_runtime_1.jsx)("div", { className: "mt-3 text-xs text-neutral-500", children: "Four-tier architecture: System > Sector > Matrix > Station" })] }), back: (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(IconNetwork, { size:
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-2 py-3 space-y-2 2xs:px-3 2xs:py-4 2xs:space-y-3 sm:px-6 sm:py-6 sm:space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-base 2xs:text-lg xs:text-xl sm:text-2xl md:text-3xl font-bold text-white tracking-wider truncate", children: "Organization" }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-400 mt-1", children: "Ecosystem structure & territory management" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg p-2 2xs:p-3 sm:p-4 md:p-6 hover:border-cyan-400/50 transition-colors", children: [(0, jsx_runtime_1.jsxs)("div", { className: "mb-1.5 2xs:mb-2 sm:mb-3 md:mb-4 flex items-center gap-1.5 2xs:gap-2 sm:gap-3 min-w-0", children: [(0, jsx_runtime_1.jsx)(IconUsers, { size: 18, className: "text-cyan-400 shrink-0" }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs 2xs:text-sm sm:text-base font-bold text-cyan-400 tracking-wide truncate", children: "User Statistics" }), (0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-neutral-500 font-mono tracking-wider truncate", children: "User Statistics" })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 xs:grid-cols-3 md:grid-cols-5 gap-1.5 2xs:gap-2 sm:gap-3", children: [
|
|
66
|
+
{ label: 'Total Users', value: totalUsers, icon: (0, jsx_runtime_1.jsx)(IconUsers, { size: 14, className: "text-cyan-400/70 shrink-0" }) },
|
|
67
|
+
{ label: 'Miner', value: miners, icon: (0, jsx_runtime_1.jsx)(IconPickaxe, { size: 14, className: "text-cyan-400/70 shrink-0" }) },
|
|
68
|
+
{ label: 'Commander', value: commanders, icon: (0, jsx_runtime_1.jsx)(IconUserCheck, { size: 14, className: "text-cyan-400/70 shrink-0" }) },
|
|
69
|
+
{ label: 'Pioneer', value: pioneers, icon: (0, jsx_runtime_1.jsx)(IconCompass, { size: 14, className: "text-cyan-400/70 shrink-0" }) },
|
|
70
|
+
{ label: 'Unassigned', value: unassigned, icon: (0, jsx_runtime_1.jsx)(IconUserX, { size: 14, className: "text-cyan-400/70 shrink-0" }) },
|
|
71
|
+
].map(({ label, value, icon }) => ((0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 bg-neutral-800 rounded border border-neutral-700 min-w-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 2xs:gap-1.5 mb-1 min-w-0", children: [icon, (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] 2xs:text-xs text-cyan-400/70 tracking-wider truncate", children: label })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-base 2xs:text-lg xs:text-xl sm:text-2xl font-bold text-white font-mono truncate", children: fmt(value) })] }, label))) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-1.5 2xs:gap-2 sm:gap-3 md:gap-4", children: [(0, jsx_runtime_1.jsx)(FlipCard, { front: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "mb-2 2xs:mb-3 sm:mb-4 flex items-center gap-1.5 2xs:gap-2 sm:gap-3 min-w-0", children: [(0, jsx_runtime_1.jsx)(IconNetwork, { size: 18, className: "text-cyan-400 shrink-0" }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs 2xs:text-sm sm:text-base font-bold text-cyan-400 tracking-wide truncate", children: "Territory Distribution" }), (0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-neutral-500 font-mono tracking-wider truncate", children: "Territory Distribution" })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 2xs:grid-cols-4 gap-1.5 2xs:gap-2 sm:gap-3", children: [
|
|
72
|
+
{ label: 'Station', count: stationCount, icon: (0, jsx_runtime_1.jsx)(IconBuilding, { size: 18, className: "text-cyan-400/70 mx-auto mb-1 2xs:mb-2" }) },
|
|
73
|
+
{ label: 'Matrix', count: matrixCount, icon: (0, jsx_runtime_1.jsx)(IconGrid, { size: 18, className: "text-cyan-400/70 mx-auto mb-1 2xs:mb-2" }) },
|
|
74
|
+
{ label: 'Sector', count: sectorCount, icon: (0, jsx_runtime_1.jsx)(IconMap, { size: 18, className: "text-cyan-400/70 mx-auto mb-1 2xs:mb-2" }) },
|
|
75
|
+
{ label: 'System', count: systemCount, icon: (0, jsx_runtime_1.jsx)(IconGlobe, { size: 18, className: "text-cyan-400/70 mx-auto mb-1 2xs:mb-2" }) },
|
|
76
|
+
].map(({ label, count, icon }) => ((0, jsx_runtime_1.jsxs)("div", { className: "text-center p-2 2xs:p-3 bg-neutral-800 rounded border border-neutral-700 min-w-0", children: [icon, (0, jsx_runtime_1.jsx)("div", { className: "text-base 2xs:text-lg xs:text-xl font-bold text-white font-mono", children: count }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-cyan-400/70 tracking-wider truncate", children: label })] }, label))) }), (0, jsx_runtime_1.jsx)("div", { className: "mt-2 2xs:mt-3 text-[10px] 2xs:text-xs text-neutral-500", children: "Four-tier architecture: System > Sector > Matrix > Station" })] }), back: (0, jsx_runtime_1.jsxs)("div", { className: "space-y-2 2xs:space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 sm:gap-3 min-w-0", children: [(0, jsx_runtime_1.jsx)(IconNetwork, { size: 18, className: "text-cyan-400 shrink-0" }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs 2xs:text-sm sm:text-base font-bold text-cyan-400 tracking-wide truncate", children: "Territory System" }), (0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-neutral-500 font-mono tracking-wider truncate", children: "Territory System" })] })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs 2xs:text-sm text-neutral-300 leading-relaxed", children: "The territory system is the organizational backbone of the Microcosm ecosystem, structuring all users into a hierarchical governance model." }), (0, jsx_runtime_1.jsxs)("div", { className: "text-xs 2xs:text-sm text-neutral-400 leading-relaxed space-y-1 2xs:space-y-1.5", children: [(0, jsx_runtime_1.jsxs)("p", { children: [(0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400/80 font-mono", children: "Station" }), " \u2014 Base unit housing up to 1,000 users"] }), (0, jsx_runtime_1.jsxs)("p", { children: [(0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400/80 font-mono", children: "Matrix" }), " \u2014 Regional group managing 10 Stations"] }), (0, jsx_runtime_1.jsxs)("p", { children: [(0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400/80 font-mono", children: "Sector" }), " \u2014 Area governance overseeing 10 Matrices"] }), (0, jsx_runtime_1.jsxs)("p", { children: [(0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400/80 font-mono", children: "System" }), " \u2014 Top-level domain containing 10 Sectors"] })] }), (0, jsx_runtime_1.jsx)("p", { className: "hidden 2xs:block text-xs 2xs:text-sm text-neutral-400 leading-relaxed", children: "Magistrates are territory managers elected through the auction system. They govern their territory and receive a share of mining companion yield." })] }) }), (0, jsx_runtime_1.jsx)(FlipCard, { front: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "mb-2 2xs:mb-3 sm:mb-4 flex items-center gap-1.5 2xs:gap-2 sm:gap-3 min-w-0", children: [(0, jsx_runtime_1.jsx)(IconBuilding, { size: 18, className: "text-cyan-400 shrink-0" }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs 2xs:text-sm sm:text-base font-bold text-cyan-400 tracking-wide truncate", children: "Vault Balance" }), (0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-neutral-500 font-mono tracking-wider truncate", children: "Vault Balance" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 sm:p-4 bg-neutral-800 rounded border border-neutral-700 min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-cyan-300 font-mono truncate", children: formatMCD(totalVaultMCD) }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs sm:text-sm text-cyan-400/50 mt-1", children: "MCD" })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-2 2xs:mt-3 text-[10px] 2xs:text-xs text-neutral-500", children: "Daily distribution: 1% of vault balance distributed to territory miners" })] }), back: (0, jsx_runtime_1.jsxs)("div", { className: "space-y-2 2xs:space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 sm:gap-3 min-w-0", children: [(0, jsx_runtime_1.jsx)(IconBuilding, { size: 18, className: "text-cyan-400 shrink-0" }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs 2xs:text-sm sm:text-base font-bold text-cyan-400 tracking-wide truncate", children: "Vault Mechanism" }), (0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-neutral-500 font-mono tracking-wider truncate", children: "Vault Mechanism" })] })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs 2xs:text-sm text-neutral-300 leading-relaxed", children: "Each territory maintains a vault that accumulates MCD from mining companion yield and distributes it to active miners daily." }), (0, jsx_runtime_1.jsxs)("div", { className: "text-xs 2xs:text-sm text-neutral-400 leading-relaxed space-y-1 2xs:space-y-1.5", children: [(0, jsx_runtime_1.jsxs)("p", { children: [(0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400/80", children: "Source" }), " \u2014 30% of mining companion yield flows to territory vault as MCD"] }), (0, jsx_runtime_1.jsxs)("p", { children: [(0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400/80", children: "Distribution" }), " \u2014 1% of vault balance distributed daily to territory miners"] }), (0, jsx_runtime_1.jsxs)("p", { children: [(0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400/80", children: "Peg" }), " \u2014 MCD is pegged 1:1 to USDT/USDC"] }), (0, jsx_runtime_1.jsxs)("p", { className: "hidden 2xs:block", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400/80", children: "Transparency" }), " \u2014 All vault balances and distributions are on-chain verifiable"] })] }), (0, jsx_runtime_1.jsx)("p", { className: "hidden 2xs:block text-xs 2xs:text-sm text-neutral-400 leading-relaxed", children: "The vault creates a positive feedback loop: more mining activity increases the vault, which increases daily payouts, attracting more miners." })] }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg p-2 2xs:p-3 sm:p-4 md:p-6 hover:border-cyan-400/50 transition-colors", children: [(0, jsx_runtime_1.jsxs)("div", { className: "mb-2 2xs:mb-3 sm:mb-4 flex items-center gap-1.5 2xs:gap-2 sm:gap-3 min-w-0", children: [(0, jsx_runtime_1.jsx)(IconCrown, { size: 18, className: "text-cyan-400 shrink-0" }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs 2xs:text-sm sm:text-base font-bold text-cyan-400 tracking-wide truncate", children: "Level Progression" }), (0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-neutral-500 font-mono tracking-wider truncate", children: "Level Progression" })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 2xs:grid-cols-2 xs:grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-1.5 2xs:gap-2 sm:gap-3", children: [
|
|
77
77
|
{ level: 3, en: 'Miner', zh: '\u77FF\u5DE5', condition: 'Register account' },
|
|
78
78
|
{ level: 4, en: 'Commander', zh: '\u6307\u6325\u5B98', condition: 'Station NFT' },
|
|
79
79
|
{ level: 5, en: 'Pioneer', zh: '\u5148\u9A71\u8005', condition: '10 Stations (auto-mint Matrix)' },
|
|
80
80
|
{ level: 6, en: 'Warden', zh: '\u5B88\u62A4\u8005', condition: '10 Matrices (auto-mint Sector)' },
|
|
81
81
|
{ level: 7, en: 'Admiral', zh: '\u63D0\u7763', condition: '10 Sectors (auto-mint System)' },
|
|
82
|
-
].map(({ level, en, zh, condition }) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-cyan-400 font-mono leading-none", children: level }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-sm font-medium text-neutral-200", children: en }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400", children: zh }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: condition })] })] }, level))) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg p-6 hover:border-cyan-400/50 transition-colors", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(IconLayers, { size:
|
|
82
|
+
].map(({ level, en, zh, condition }) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 2xs:gap-3 p-2 2xs:p-3 bg-neutral-800 rounded border border-neutral-700 min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl font-bold text-cyan-400 font-mono leading-none shrink-0", children: level }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0 flex-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs 2xs:text-sm font-medium text-neutral-200 truncate", children: en }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-neutral-400 truncate", children: zh }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-neutral-500 truncate", children: condition })] })] }, level))) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg p-2 2xs:p-3 sm:p-4 md:p-6 hover:border-cyan-400/50 transition-colors", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-2 2xs:mb-3 sm:mb-4 gap-2 min-w-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 sm:gap-3 min-w-0", children: [(0, jsx_runtime_1.jsx)(IconLayers, { size: 18, className: "text-cyan-400 shrink-0" }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs 2xs:text-sm sm:text-base font-bold text-cyan-400 tracking-wide truncate", children: "Territory Architecture" }), (0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-neutral-500 font-mono tracking-wider truncate", children: "Territory Structure" })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "hidden sm:flex items-center gap-3 text-[10px] font-mono text-neutral-500", children: [
|
|
83
83
|
{ label: 'System', color: 'bg-purple-400' },
|
|
84
84
|
{ label: 'Sector', color: 'bg-blue-400' },
|
|
85
85
|
{ label: 'Matrix', color: 'bg-cyan-400' },
|
|
86
86
|
{ label: 'Station', color: 'bg-emerald-400' },
|
|
87
|
-
].map(({ label, color }) => ((0, jsx_runtime_1.jsxs)("span", { className: "flex items-center gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: `w-1.5 h-1.5 rounded-full ${color}` }), label] }, label))) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "relative rounded-lg border border-neutral-800 overflow-hidden bg-neutral-950/50 p-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 opacity-5", children: (0, jsx_runtime_1.jsxs)("svg", { className: "w-full h-full", children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("pattern", { id: "org-grid", width: "40", height: "40", patternUnits: "userSpaceOnUse", children: (0, jsx_runtime_1.jsx)("path", { d: "M 40 0 L 0 0 0 40", fill: "none", stroke: "#22d3ee", strokeWidth: "0.5" }) }) }), (0, jsx_runtime_1.jsx)("rect", { width: "100%", height: "100%", fill: "url(#org-grid)" })] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "relative z-10 space-y-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex justify-center", children: (0, jsx_runtime_1.jsxs)("div", { className: "inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border border-purple-500/40 bg-purple-500/10", children: [(0, jsx_runtime_1.jsx)(IconGlobe, { size: 16, className: "text-purple-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm font-bold text-purple-300 font-mono", children: "System" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] text-purple-400/60 ml-1", children: "100,000 users" })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center py-1", children: (0, jsx_runtime_1.jsx)("div", { className: "w-px h-6 bg-gradient-to-b from-purple-500/40 to-blue-500/40" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center pb-1", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[9px] text-neutral-600 font-mono", children: "10x" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-center gap-3", children: [[1, 2, 3].map((i) => ((0, jsx_runtime_1.jsxs)("div", { className: "inline-flex items-center gap-2 px-3 py-2 rounded-lg border border-blue-500/40 bg-blue-500/10", children: [(0, jsx_runtime_1.jsx)(IconMap, { size: 14, className: "text-blue-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-bold text-blue-300 font-mono", children: "Sector" })] }, i))), (0, jsx_runtime_1.jsx)("div", { className: "inline-flex items-center px-3 py-2 rounded-lg border border-neutral-700 bg-neutral-800/50", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-500 font-mono", children: "... x10" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center py-1", children: (0, jsx_runtime_1.jsx)("div", { className: "w-px h-6 bg-gradient-to-b from-blue-500/40 to-cyan-500/40" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center pb-1", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[9px] text-neutral-600 font-mono", children: "10x" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-center gap-3", children: [[1, 2, 3, 4].map((i) => ((0, jsx_runtime_1.jsxs)("div", { className: "inline-flex items-center gap-2 px-3 py-2 rounded-lg border border-cyan-500/40 bg-cyan-500/10", children: [(0, jsx_runtime_1.jsx)(IconGrid, { size: 14, className: "text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-bold text-cyan-300 font-mono", children: "Matrix" })] }, i))), (0, jsx_runtime_1.jsx)("div", { className: "inline-flex items-center px-3 py-2 rounded-lg border border-neutral-700 bg-neutral-800/50", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-500 font-mono", children: "... x10" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center py-1", children: (0, jsx_runtime_1.jsx)("div", { className: "w-px h-6 bg-gradient-to-b from-cyan-500/40 to-emerald-500/40" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center pb-1", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[9px] text-neutral-600 font-mono", children: "10x" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-center gap-3", children: [[1, 2, 3, 4, 5].map((i) => ((0, jsx_runtime_1.jsxs)("div", { className: "inline-flex items-center gap-2 px-3 py-2 rounded-lg border border-emerald-500/40 bg-emerald-500/10", children: [(0, jsx_runtime_1.jsx)(IconBuilding, { size: 14, className: "text-emerald-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-bold text-emerald-300 font-mono", children: "Station" })] }, i))), (0, jsx_runtime_1.jsx)("div", { className: "inline-flex items-center px-3 py-2 rounded-lg border border-neutral-700 bg-neutral-800/50", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-500 font-mono", children: "... x10" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center pt-4", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] text-neutral-600 font-mono", children: "Each station: 1,000 users capacity | Managed by Magistrate (via auction)" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "relative z-10 mt-4 sm:mt-6 grid grid-cols-2 lg:grid-cols-4 gap-2 sm:gap-3", children: [
|
|
87
|
+
].map(({ label, color }) => ((0, jsx_runtime_1.jsxs)("span", { className: "flex items-center gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: `w-1.5 h-1.5 rounded-full ${color}` }), label] }, label))) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "relative rounded-lg border border-neutral-800 overflow-hidden bg-neutral-950/50 p-2 2xs:p-3 sm:p-4 md:p-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 opacity-5", children: (0, jsx_runtime_1.jsxs)("svg", { className: "w-full h-full", children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("pattern", { id: "org-grid", width: "40", height: "40", patternUnits: "userSpaceOnUse", children: (0, jsx_runtime_1.jsx)("path", { d: "M 40 0 L 0 0 0 40", fill: "none", stroke: "#22d3ee", strokeWidth: "0.5" }) }) }), (0, jsx_runtime_1.jsx)("rect", { width: "100%", height: "100%", fill: "url(#org-grid)" })] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "relative z-10 space-y-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex justify-center", children: (0, jsx_runtime_1.jsxs)("div", { className: "inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border border-purple-500/40 bg-purple-500/10", children: [(0, jsx_runtime_1.jsx)(IconGlobe, { size: 16, className: "text-purple-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm font-bold text-purple-300 font-mono", children: "System" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] text-purple-400/60 ml-1", children: "100,000 users" })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center py-1", children: (0, jsx_runtime_1.jsx)("div", { className: "w-px h-6 bg-gradient-to-b from-purple-500/40 to-blue-500/40" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center pb-1", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[9px] text-neutral-600 font-mono", children: "10x" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-center gap-3", children: [[1, 2, 3].map((i) => ((0, jsx_runtime_1.jsxs)("div", { className: "inline-flex items-center gap-2 px-3 py-2 rounded-lg border border-blue-500/40 bg-blue-500/10", children: [(0, jsx_runtime_1.jsx)(IconMap, { size: 14, className: "text-blue-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-bold text-blue-300 font-mono", children: "Sector" })] }, i))), (0, jsx_runtime_1.jsx)("div", { className: "inline-flex items-center px-3 py-2 rounded-lg border border-neutral-700 bg-neutral-800/50", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-500 font-mono", children: "... x10" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center py-1", children: (0, jsx_runtime_1.jsx)("div", { className: "w-px h-6 bg-gradient-to-b from-blue-500/40 to-cyan-500/40" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center pb-1", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[9px] text-neutral-600 font-mono", children: "10x" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-center gap-3", children: [[1, 2, 3, 4].map((i) => ((0, jsx_runtime_1.jsxs)("div", { className: "inline-flex items-center gap-2 px-3 py-2 rounded-lg border border-cyan-500/40 bg-cyan-500/10", children: [(0, jsx_runtime_1.jsx)(IconGrid, { size: 14, className: "text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-bold text-cyan-300 font-mono", children: "Matrix" })] }, i))), (0, jsx_runtime_1.jsx)("div", { className: "inline-flex items-center px-3 py-2 rounded-lg border border-neutral-700 bg-neutral-800/50", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-500 font-mono", children: "... x10" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center py-1", children: (0, jsx_runtime_1.jsx)("div", { className: "w-px h-6 bg-gradient-to-b from-cyan-500/40 to-emerald-500/40" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center pb-1", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[9px] text-neutral-600 font-mono", children: "10x" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-center gap-3", children: [[1, 2, 3, 4, 5].map((i) => ((0, jsx_runtime_1.jsxs)("div", { className: "inline-flex items-center gap-2 px-3 py-2 rounded-lg border border-emerald-500/40 bg-emerald-500/10", children: [(0, jsx_runtime_1.jsx)(IconBuilding, { size: 14, className: "text-emerald-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-bold text-emerald-300 font-mono", children: "Station" })] }, i))), (0, jsx_runtime_1.jsx)("div", { className: "inline-flex items-center px-3 py-2 rounded-lg border border-neutral-700 bg-neutral-800/50", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-500 font-mono", children: "... x10" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center pt-4", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] text-neutral-600 font-mono", children: "Each station: 1,000 users capacity | Managed by Magistrate (via auction)" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "relative z-10 mt-3 2xs:mt-4 sm:mt-6 grid grid-cols-1 2xs:grid-cols-2 lg:grid-cols-4 gap-1.5 2xs:gap-2 sm:gap-3", children: [
|
|
88
88
|
{ type: 'System', color: 'border-purple-500/30 bg-purple-500/5', textColor: 'text-purple-300', desc: 'Top-level domain', capacity: '100,000', count: systemCount },
|
|
89
89
|
{ type: 'Sector', color: 'border-blue-500/30 bg-blue-500/5', textColor: 'text-blue-300', desc: 'Area governance', capacity: '10,000', count: sectorCount },
|
|
90
90
|
{ type: 'Matrix', color: 'border-cyan-500/30 bg-cyan-500/5', textColor: 'text-cyan-300', desc: 'Regional group', capacity: '1,000 x10', count: matrixCount },
|
|
91
91
|
{ type: 'Station', color: 'border-emerald-500/30 bg-emerald-500/5', textColor: 'text-emerald-300', desc: 'Base unit', capacity: '1,000', count: stationCount },
|
|
92
|
-
].map(({ type, color, textColor, desc, capacity, count }) => ((0, jsx_runtime_1.jsxs)("div", { className: `rounded-lg border p-3 ${color}`, children: [(0, jsx_runtime_1.jsx)("div", { className: `text-sm font-bold font-mono ${textColor}`, children: type }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 mt-0.5", children: desc }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-baseline justify-between mt-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-[10px] text-neutral-500 font-mono", children: [capacity, " users"] }), (0, jsx_runtime_1.jsx)("span", { className: `text-lg font-bold font-mono ${textColor}`, children: count })] })] }, type))) })] })] })] }));
|
|
92
|
+
].map(({ type, color, textColor, desc, capacity, count }) => ((0, jsx_runtime_1.jsxs)("div", { className: `rounded-lg border p-2 2xs:p-3 min-w-0 ${color}`, children: [(0, jsx_runtime_1.jsx)("div", { className: `text-xs 2xs:text-sm font-bold font-mono truncate ${textColor}`, children: type }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-neutral-400 mt-0.5 truncate", children: desc }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-baseline justify-between mt-1 2xs:mt-2 gap-2 min-w-0", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-[8px] 2xs:text-[10px] text-neutral-500 font-mono truncate", children: [capacity, " users"] }), (0, jsx_runtime_1.jsx)("span", { className: `text-base 2xs:text-lg font-bold font-mono shrink-0 ${textColor}`, children: count })] })] }, type))) })] })] })] }));
|
|
93
93
|
}
|
|
@@ -40,9 +40,9 @@ function MicrocosmEmailChangeCard({ onSuccess } = {}) {
|
|
|
40
40
|
catch { }
|
|
41
41
|
};
|
|
42
42
|
if (step === 'idle') {
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2 mb-3", children: (0, jsx_runtime_1.jsx)("span", { className: "text-sm text-neutral-300 font-medium tracking-wider", children: t('changeEmail', 'CHANGE EMAIL') }) }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-400 mb-3", children: t('changeEmailDesc', 'Update your email address. A verification code will be sent to the new email.') }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setStep('form'), className: "px-3 py-1.5 border border-neutral-700 text-neutral-300 hover:bg-neutral-800 rounded text-xs", children: t('changeEmailBtn', 'Change Email') })] }));
|
|
43
|
+
return ((0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2 mb-2 2xs:mb-3", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs 2xs:text-sm text-neutral-300 font-medium tracking-wider", children: t('changeEmail', 'CHANGE EMAIL') }) }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs text-neutral-400 mb-2 2xs:mb-3", children: t('changeEmailDesc', 'Update your email address. A verification code will be sent to the new email.') }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setStep('form'), className: "px-3 py-1.5 border border-neutral-700 text-neutral-300 hover:bg-neutral-800 rounded text-xs", children: t('changeEmailBtn', 'Change Email') })] }));
|
|
44
44
|
}
|
|
45
|
-
return ((0, jsx_runtime_1.jsx)(terminal_1.TerminalCard, { children: (0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-sm text-neutral-300 font-medium tracking-wider", children: t('changeEmail', 'CHANGE EMAIL') }) }), error && ((0, jsx_runtime_1.jsx)("div", { className: "p-2 bg-red-900/20 border border-red-800 rounded text-xs text-red-300", children: error })), step === 'form' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("input", { type: "email", value: newEmail, onChange: (e) => setNewEmail(e.target.value), placeholder: t('newEmailPlaceholder', 'New email address'), className: "w-full bg-neutral-800 border border-neutral-700 text-white p-2 rounded text-sm outline-none focus:border-cyan-500" }), (0, jsx_runtime_1.jsx)("input", { type: "password", value: password, onChange: (e) => setPassword(e.target.value), placeholder: t('currentPasswordPlaceholder', 'Current password'), className: "w-full bg-neutral-800 border border-neutral-700 text-white p-2 rounded text-sm outline-none focus:border-cyan-500" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => {
|
|
45
|
+
return ((0, jsx_runtime_1.jsx)(terminal_1.TerminalCard, { children: (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3 2xs:space-y-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs 2xs:text-sm text-neutral-300 font-medium tracking-wider", children: t('changeEmail', 'CHANGE EMAIL') }) }), error && ((0, jsx_runtime_1.jsx)("div", { className: "p-2 bg-red-900/20 border border-red-800 rounded text-xs text-red-300", children: error })), step === 'form' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("input", { type: "email", value: newEmail, onChange: (e) => setNewEmail(e.target.value), placeholder: t('newEmailPlaceholder', 'New email address'), className: "w-full bg-neutral-800 border border-neutral-700 text-white p-2 rounded text-xs 2xs:text-sm outline-none focus:border-cyan-500" }), (0, jsx_runtime_1.jsx)("input", { type: "password", value: password, onChange: (e) => setPassword(e.target.value), placeholder: t('currentPasswordPlaceholder', 'Current password'), className: "w-full bg-neutral-800 border border-neutral-700 text-white p-2 rounded text-xs 2xs:text-sm outline-none focus:border-cyan-500" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => {
|
|
46
46
|
setStep('idle');
|
|
47
47
|
setNewEmail('');
|
|
48
48
|
setPassword('');
|
|
@@ -128,15 +128,15 @@ function MicrocosmProfilePage({ walletSection, } = {}) {
|
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
130
|
if (loading) {
|
|
131
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-
|
|
131
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-2 py-3 space-y-2 2xs:px-3 2xs:py-4 2xs:space-y-3 sm:px-6 sm:py-6 sm:space-y-6 font-mono", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-base 2xs:text-lg xs:text-xl sm:text-2xl md:text-3xl font-bold text-white tracking-wider truncate", children: t('title', 'Profile') }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-400", children: t('subtitle', 'View and manage your personal information') })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-20", children: (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: t('loadingProfile', 'Loading profile...') }) })] }));
|
|
132
132
|
}
|
|
133
133
|
const displayName = profile?.display_name || profile?.email?.split('@')[0] || 'user';
|
|
134
134
|
const lvl = (levelData?.current_rank || levelData?.database_level || 'miner').toLowerCase();
|
|
135
135
|
const lvlInfo = LEVEL_INFO[lvl] || LEVEL_INFO.miner;
|
|
136
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-
|
|
136
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-2 py-3 space-y-2 2xs:px-3 2xs:py-4 2xs:space-y-3 sm:px-6 sm:py-6 sm:space-y-6 font-mono", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-base 2xs:text-lg xs:text-xl sm:text-2xl md:text-3xl font-bold text-white tracking-wider truncate", children: t('title', 'Profile') }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-400", children: t('subtitle', 'View and manage your personal information') })] }), error && ((0, jsx_runtime_1.jsx)("div", { className: "p-3 bg-red-900/20 border border-red-800 rounded text-sm text-red-300", children: error })), (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col 2xs:flex-row items-start gap-3 2xs:gap-4 mb-4 2xs:mb-6 pb-4 2xs:pb-6 border-b border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "relative group shrink-0", children: [profile?.avatar_url ? ((0, jsx_runtime_1.jsx)("img", { src: profile.avatar_url, alt: "", className: "h-16 w-16 2xs:h-20 2xs:w-20 rounded bg-neutral-800 border border-neutral-700 object-cover" })) : ((0, jsx_runtime_1.jsx)("div", { className: "h-16 w-16 2xs:h-20 2xs:w-20 rounded bg-cyan-400/20 border border-cyan-400/30 flex items-center justify-center text-cyan-400 text-2xl 2xs:text-3xl font-bold", children: displayName.charAt(0).toUpperCase() })), (0, jsx_runtime_1.jsx)("button", { onClick: () => fileInputRef.current?.click(), disabled: uploadingAvatar, className: "absolute inset-0 bg-black/50 rounded opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center text-white text-xs disabled:opacity-30", children: uploadingAvatar ? '...' : t('edit', 'edit') }), (0, jsx_runtime_1.jsx)("input", { ref: fileInputRef, type: "file", accept: "image/jpeg,image/png,image/gif,image/webp", onChange: handleAvatarChange, className: "hidden" })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 min-w-0 w-full", children: editing ? ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsx)("input", { type: "text", value: editName, onChange: (e) => setEditName(e.target.value), className: "w-full bg-neutral-800 border border-neutral-600 rounded px-3 py-2 text-white text-sm focus:outline-none focus:border-cyan-400", placeholder: t('displayName', 'Display name') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)("button", { onClick: handleSave, disabled: saving, className: "px-3 py-1.5 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-sm disabled:opacity-50", children: saving ? t('saving', 'Saving...') : t('save', 'Save') }), (0, jsx_runtime_1.jsx)("button", { onClick: () => {
|
|
137
137
|
setEditName(profile?.display_name || '');
|
|
138
138
|
setEditing(false);
|
|
139
|
-
}, disabled: saving, className: "px-3 py-1.5 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 rounded text-sm", children: t('cancel', 'Cancel') })] })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-lg text-white", children: displayName }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => setEditing(true), className: "text-xs text-neutral-500 hover:text-cyan-400", children: ["[", t('edit', 'edit'), "]"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm text-neutral-400 mt-1", children: profile?.email || t('noEmail', '(no email)') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2 mt-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "px-2 py-0.5 bg-neutral-800 text-neutral-300 rounded text-xs border border-neutral-700", children: profile?.role || t('normalUser', 'user') }), profile?.email_verified ? ((0, jsx_runtime_1.jsx)("span", { className: "px-2 py-0.5 bg-green-900/30 text-green-400 rounded text-xs border border-green-800", children: t('verified', 'verified') })) : ((0, jsx_runtime_1.jsx)("span", { className: "px-2 py-0.5 bg-red-900/30 text-red-400 rounded text-xs border border-red-800", children: t('unverified', 'unverified') }))] })] })) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1
|
|
139
|
+
}, disabled: saving, className: "px-3 py-1.5 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 rounded text-sm", children: t('cancel', 'Cancel') })] })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-base 2xs:text-lg xs:text-xl text-white truncate", children: displayName }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => setEditing(true), className: "text-xs text-neutral-500 hover:text-cyan-400", children: ["[", t('edit', 'edit'), "]"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs 2xs:text-sm text-neutral-400 mt-1 truncate", children: profile?.email || t('noEmail', '(no email)') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-1.5 2xs:gap-2 mt-2 flex-wrap", children: [(0, jsx_runtime_1.jsx)("span", { className: "px-2 py-0.5 bg-neutral-800 text-neutral-300 rounded text-xs border border-neutral-700", children: profile?.role || t('normalUser', 'user') }), profile?.email_verified ? ((0, jsx_runtime_1.jsx)("span", { className: "px-2 py-0.5 bg-green-900/30 text-green-400 rounded text-xs border border-green-800", children: t('verified', 'verified') })) : ((0, jsx_runtime_1.jsx)("span", { className: "px-2 py-0.5 bg-red-900/30 text-red-400 rounded text-xs border border-red-800", children: t('unverified', 'unverified') }))] })] })) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 2xs:grid-cols-2 gap-2 2xs:gap-3 sm:gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-3 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-neutral-400 tracking-wider mb-1", children: "UID" }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-white font-mono", children: profile?.uid || userInfo?.uid || '-' })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-3 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-neutral-400 tracking-wider mb-1", children: t('shortId', 'Short ID') }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs 2xs:text-sm text-white font-mono truncate", children: profile?.short_id || '-' })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-3 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-neutral-400 tracking-wider mb-1", children: t('created', 'Created') }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs 2xs:text-sm text-white truncate", children: formatDate(profile?.created_at) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-3 sm:p-4 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-neutral-400 tracking-wider mb-1", children: t('lastLogin', 'Last Login') }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs 2xs:text-sm text-white truncate", children: formatDate(profile?.last_login_at) })] })] })] }), levelData && ((0, jsx_runtime_1.jsx)(terminal_1.TerminalCard, { title: t('levelStatus', 'Level Status'), children: (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3 2xs:space-y-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-start justify-between gap-2 p-3 2xs:p-4 bg-neutral-800 rounded", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0 flex-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-neutral-400 tracking-wider mb-1 truncate", children: t('currentLevel', 'CURRENT LEVEL') }), (0, jsx_runtime_1.jsx)("div", { className: `text-base 2xs:text-lg xs:text-xl font-bold truncate ${lvlInfo.color}`, children: lvlInfo.label }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-neutral-500 mt-1 line-clamp-2", children: lvlInfo.description })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-right shrink-0 min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-neutral-400 tracking-wider mb-1 truncate", children: t('holdings', 'HOLDINGS') }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[10px] 2xs:text-xs text-white font-mono", children: ["S:", levelData.holdings?.station ?? 0, " M:", levelData.holdings?.matrix ?? 0, " Se:", levelData.holdings?.sector ?? 0, " Sy:", levelData.holdings?.system ?? 0] })] })] }), levelData.next_level_requirement && ((0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center mb-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400 tracking-wider", children: t('progress', 'PROGRESS') }), (0, jsx_runtime_1.jsxs)("span", { className: "text-white text-sm font-mono", children: [levelData.progress_percent ?? 0, "%"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "w-full bg-neutral-900 rounded-full h-2", children: (0, jsx_runtime_1.jsx)("div", { className: "h-2 rounded-full bg-cyan-400 transition-all", style: { width: `${Math.min(levelData.progress_percent ?? 0, 100)}%` } }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500 mt-2", children: levelData.next_level_requirement.description || '' }), (0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-400 mt-1", children: [levelData.next_level_requirement.have, "/", levelData.next_level_requirement.need, ' ', levelData.next_level_requirement.tier, " \u2192 ", ' ', (0, jsx_runtime_1.jsx)("span", { className: "text-white", children: levelData.next_rank })] })] }))] }) })), (0, jsx_runtime_1.jsx)(terminal_1.TerminalCard, { title: t('emailVerification', 'Email Verification'), children: (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", 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)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t('status', 'STATUS') }), profile?.email_verified ? ((0, jsx_runtime_1.jsx)("div", { className: "text-green-400 text-sm", children: t('statusVerified', 'Verified') })) : ((0, jsx_runtime_1.jsx)("div", { className: "text-red-400 text-sm", children: t('statusUnverified', 'Unverified') }))] }), !profile?.email_verified && ((0, jsx_runtime_1.jsx)("button", { onClick: async () => {
|
|
140
140
|
setResendingVerification(true);
|
|
141
141
|
setResendMessage(null);
|
|
142
142
|
try {
|
|
@@ -61,7 +61,7 @@ function MicrocosmTwoFactorSettings({} = {}) {
|
|
|
61
61
|
};
|
|
62
62
|
if (loading && !status)
|
|
63
63
|
return null;
|
|
64
|
-
return ((0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-sm text-neutral-300 font-medium tracking-wider", children: t('twoFactorAuth', 'TWO FACTOR AUTH') }) }), (0, jsx_runtime_1.jsx)("span", { className: `px-2 py-0.5 rounded text-xs ${status?.enabled ? 'bg-green-900/30 text-green-400 border border-green-800' : 'bg-neutral-800 text-neutral-400 border border-neutral-700'}`, children: status?.enabled ? t('enabled', 'enabled') : t('disabled', 'disabled') })] }), error && ((0, jsx_runtime_1.jsx)("div", { className: "p-2 bg-red-900/20 border border-red-800 rounded text-xs text-red-300 mb-3", children: error })), step === 'idle' && !status?.enabled && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-400", children: t('twoFactorDesc', 'Add an extra layer of security using Google Authenticator or any TOTP app.') }), (0, jsx_runtime_1.jsx)("button", { onClick: handleBegin, disabled: loading, className: "px-3 py-1.5 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-xs disabled:opacity-50", children: loading ? t('settingUp', 'Setting up...') : t('enable2fa', 'Enable 2FA') })] })), step === 'idle' && status?.enabled && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-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.jsx)("div", { className: "text-xs text-neutral-400 mb-1", children: t('status', 'STATUS') }), (0, jsx_runtime_1.jsxs)("div", { className: "text-green-400 text-sm", children: [t('active', 'Active'), " ", status.created_at ? `${t('since', 'since')} ${new Date(status.created_at).toLocaleDateString()}` : ''] })] }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setStep('disable'), className: "px-3 py-1.5 border border-red-900 text-red-400 hover:bg-red-950 rounded text-xs", children: t('disable2fa', 'Disable 2FA') })] })), step === 'qr' && setupData && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-400", children: t('scanQrStep', '1. Scan this QR code with Google Authenticator or any TOTP app.') }), setupData.qr_code && ((0, jsx_runtime_1.jsx)("div", { className: "flex justify-center bg-white rounded p-4", children: (0, jsx_runtime_1.jsx)("img", { src: setupData.qr_code.startsWith('data:') ? setupData.qr_code : `data:image/png;base64,${setupData.qr_code}`, alt: "2FA QR Code", className: "w-48 h-48" }) })), (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 justify-between mb-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400", children: t('manualKey', 'MANUAL KEY') }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setShowSecret(!showSecret), className: "text-neutral-500 hover:text-neutral-300 text-xs", children: showSecret ? t('hide', 'hide') : t('show', 'show') })] }), (0, jsx_runtime_1.jsx)("code", { className: "text-xs text-cyan-400
|
|
64
|
+
return ((0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2 mb-3 2xs:mb-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2 min-w-0", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs 2xs:text-sm text-neutral-300 font-medium tracking-wider truncate", children: t('twoFactorAuth', 'TWO FACTOR AUTH') }) }), (0, jsx_runtime_1.jsx)("span", { className: `px-2 py-0.5 rounded text-[10px] 2xs:text-xs whitespace-nowrap shrink-0 ${status?.enabled ? 'bg-green-900/30 text-green-400 border border-green-800' : 'bg-neutral-800 text-neutral-400 border border-neutral-700'}`, children: status?.enabled ? t('enabled', 'enabled') : t('disabled', 'disabled') })] }), error && ((0, jsx_runtime_1.jsx)("div", { className: "p-2 bg-red-900/20 border border-red-800 rounded text-xs text-red-300 mb-3", children: error })), step === 'idle' && !status?.enabled && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-400", children: t('twoFactorDesc', 'Add an extra layer of security using Google Authenticator or any TOTP app.') }), (0, jsx_runtime_1.jsx)("button", { onClick: handleBegin, disabled: loading, className: "px-3 py-1.5 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-xs disabled:opacity-50", children: loading ? t('settingUp', 'Setting up...') : t('enable2fa', 'Enable 2FA') })] })), step === 'idle' && status?.enabled && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-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.jsx)("div", { className: "text-xs text-neutral-400 mb-1", children: t('status', 'STATUS') }), (0, jsx_runtime_1.jsxs)("div", { className: "text-green-400 text-sm", children: [t('active', 'Active'), " ", status.created_at ? `${t('since', 'since')} ${new Date(status.created_at).toLocaleDateString()}` : ''] })] }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setStep('disable'), className: "px-3 py-1.5 border border-red-900 text-red-400 hover:bg-red-950 rounded text-xs", children: t('disable2fa', 'Disable 2FA') })] })), step === 'qr' && setupData && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-400", children: t('scanQrStep', '1. Scan this QR code with Google Authenticator or any TOTP app.') }), setupData.qr_code && ((0, jsx_runtime_1.jsx)("div", { className: "flex justify-center bg-white rounded p-3 2xs:p-4", children: (0, jsx_runtime_1.jsx)("img", { src: setupData.qr_code.startsWith('data:') ? setupData.qr_code : `data:image/png;base64,${setupData.qr_code}`, alt: "2FA QR Code", className: "w-40 h-40 2xs:w-48 2xs:h-48" }) })), (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 justify-between mb-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400", children: t('manualKey', 'MANUAL KEY') }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setShowSecret(!showSecret), className: "text-neutral-500 hover:text-neutral-300 text-xs", children: showSecret ? t('hide', 'hide') : t('show', 'show') })] }), (0, jsx_runtime_1.jsx)("code", { className: "text-xs text-cyan-400", children: showSecret ? setupData.secret : '••••••••••••••••' })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-400", children: t('enter6DigitCode', '2. Enter the 6-digit code from your app.') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)("input", { type: "text", value: verifyCode, onChange: (e) => setVerifyCode(e.target.value.replace(/\D/g, '').slice(0, 6)), placeholder: "000000", className: "flex-1 bg-neutral-800 border border-neutral-700 text-white p-2 rounded text-center text-lg font-mono tracking-[0.5em] outline-none focus:border-cyan-500", maxLength: 6 }), (0, jsx_runtime_1.jsx)("button", { onClick: handleVerify, disabled: loading || verifyCode.length !== 6, className: "px-4 py-2 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-xs disabled:opacity-50", children: loading ? t('verifying', 'Verifying...') : t('verify', 'Verify') })] }), (0, jsx_runtime_1.jsx)("button", { onClick: () => {
|
|
65
65
|
setStep('idle');
|
|
66
66
|
setVerifyCode('');
|
|
67
67
|
clearSetup();
|
|
@@ -67,9 +67,9 @@ function MicrocosmQueueStatusPage({} = {}) {
|
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
if (loading) {
|
|
70
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-
|
|
70
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-2 py-3 space-y-2 2xs:px-3 2xs:py-4 2xs:space-y-3 sm:px-6 sm:py-6 sm:space-y-6 font-mono", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-base 2xs:text-lg xs:text-xl sm:text-2xl md:text-3xl font-bold text-white tracking-wider truncate", children: t('title', 'Territory Position Management') }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-400", children: t('subtitle', 'Onboarding, queuing, and territory assignment management') })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-20", children: (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: t('loading', 'Loading...') }) })] }));
|
|
71
71
|
}
|
|
72
72
|
const level = userQueue?.user_type?.toLowerCase() || 'miner';
|
|
73
73
|
const levelLabel = LEVEL_LABELS[level] || 'Miner';
|
|
74
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-
|
|
74
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-2 py-3 space-y-2 2xs:px-3 2xs:py-4 2xs:space-y-3 sm:px-6 sm:py-6 sm:space-y-6 font-mono", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0 flex-1", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-base 2xs:text-lg xs:text-xl sm:text-2xl md:text-3xl font-bold text-white tracking-wider truncate", children: t('title', 'Territory Position Management') }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-400", children: t('subtitle', 'Onboarding, queuing, and territory assignment management') })] }), (0, jsx_runtime_1.jsx)("button", { onClick: loadStatus, className: "px-2 py-1 2xs:px-3 2xs:py-1.5 text-[10px] 2xs:text-xs border border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-white rounded transition-colors whitespace-nowrap shrink-0", children: t('refresh', 'Refresh') })] }), error && ((0, jsx_runtime_1.jsx)("div", { className: "p-3 bg-red-900/20 border border-red-800 rounded text-sm text-red-300", children: error })), (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "p-3 2xs:p-4 bg-neutral-800 rounded mb-3 2xs:mb-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-[#5EEAD4] tracking-widest uppercase truncate", children: t('currentLevel', 'CURRENT LEVEL') }), (0, jsx_runtime_1.jsx)("div", { className: "text-base 2xs:text-lg xs:text-xl font-bold text-cyan-300 truncate", children: levelLabel })] }), (0, jsx_runtime_1.jsxs)("span", { className: "px-2 2xs:px-3 py-1 bg-cyan-900/30 text-cyan-300 rounded border border-cyan-700 text-[10px] 2xs:text-xs whitespace-nowrap shrink-0", children: ["Lv.", Object.keys(LEVEL_LABELS).indexOf(level) + 3] })] }) }), userQueue?.is_onboarded ? ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-950 rounded-lg p-3 2xs:p-4 sm:p-6 border border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-base 2xs:text-lg font-semibold text-white", children: t('onboarded', 'Onboarded') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('onboardedTo', 'You have been onboarded to {station}', { station: userQueue.station_name || userQueue.territory_id || '' }) })] }), (0, jsx_runtime_1.jsx)("span", { className: "px-2 py-1 bg-white/20 text-white rounded text-xs", children: t('active', 'Active') })] }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 gap-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 rounded-lg p-4 text-center", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-xl font-bold text-white", children: userQueue.territory_id }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('territoryId', 'Territory ID') })] }) })] })) : userQueue?.in_queue ? ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-950 rounded-lg p-3 2xs:p-4 sm:p-6 border border-neutral-800", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-base 2xs:text-lg font-semibold text-white", children: t('inQueue', 'In Queue') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('waitingAssignment', 'You are waiting for territory assignment') })] }), userQueue.status && ((0, jsx_runtime_1.jsx)("span", { className: "px-2 py-1 bg-cyan-900/30 text-cyan-300 rounded text-xs", children: userQueue.status }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-2 2xs:gap-3 sm:gap-4 mb-3 2xs:mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-center min-w-0", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-white truncate", children: userQueue.position || '-' }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs text-neutral-400 truncate", children: t('queuePosition', 'Queue Position') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center min-w-0", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-white truncate", children: userQueue.estimated_wait_minutes || '-' }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs text-neutral-400 truncate", children: t('estimatedWait', 'Est. Wait (min)') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center min-w-0", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-xs 2xs:text-sm font-semibold text-white truncate", children: userQueue.preferred_territory_id || t('autoAssign', 'Auto Assign') }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs text-neutral-400 truncate", children: t('preferredTerritory', 'Preferred Territory') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center min-w-0", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-xs 2xs:text-sm font-semibold text-white truncate", children: userQueue.joined_at ? new Date(userQueue.joined_at).toLocaleString() : '-' }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs text-neutral-400 truncate", children: t('joinTime', 'Join Time') })] })] }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setShowCancelConfirm(true), disabled: submitting, className: "w-full py-2 bg-neutral-800 hover:bg-neutral-700 text-white rounded transition-colors disabled:opacity-50 text-xs 2xs:text-sm whitespace-nowrap", children: t('cancelQueue', 'Cancel Queue') })] })) : ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-950 rounded-lg p-3 2xs:p-4 sm:p-6 border border-neutral-800", children: [(0, jsx_runtime_1.jsxs)("div", { className: "mb-4", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-base 2xs:text-lg font-semibold text-white", children: t('notOnboarded', 'Not Onboarded') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('notOnboardedDesc', 'You have not been onboarded to any territory') })] }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setShowJoinConfirm(true), disabled: submitting, className: "w-full py-2 bg-white/20 hover:bg-neutral-800 text-white border border-neutral-700 rounded transition-colors disabled:opacity-50 text-xs 2xs:text-sm whitespace-nowrap", children: t('joinQueue', 'Join Queue') })] }))] }), showJoinConfirm && ((0, jsx_runtime_1.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4", onClick: () => setShowJoinConfirm(false), children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg w-full max-w-md p-6 space-y-4", onClick: e => e.stopPropagation(), children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-white font-medium", children: t('joinDialogTitle', 'Join Territory') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('joinDialogDesc', 'Choose to join a specific territory or auto-assign') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => setShowJoinConfirm(false), className: "flex-1 px-3 py-2 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 rounded text-sm", children: t('cancel', 'Cancel') }), (0, jsx_runtime_1.jsx)("button", { onClick: handleJoin, disabled: submitting, className: "flex-1 px-3 py-2 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-sm disabled:opacity-50", children: submitting ? t('submitting', 'Processing...') : t('immediateJoin', 'Join Immediately') })] })] }) })), showCancelConfirm && ((0, jsx_runtime_1.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4", onClick: () => setShowCancelConfirm(false), children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg w-full max-w-md p-6 space-y-4", onClick: e => e.stopPropagation(), children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-white font-medium", children: t('cancelQueueTitle', 'Cancel Queue') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: t('cancelQueueDesc', 'Are you sure you want to cancel queuing? You will need to rejoin the queue to get onboarded.') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => setShowCancelConfirm(false), className: "flex-1 px-3 py-2 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 rounded text-sm", children: t('goBack', 'Go Back') }), (0, jsx_runtime_1.jsx)("button", { onClick: handleCancel, disabled: submitting, className: "flex-1 px-3 py-2 bg-red-700 hover:bg-red-600 text-white rounded text-sm disabled:opacity-50", children: submitting ? t('submitting', 'Processing...') : t('confirmCancel', 'Confirm Cancel') })] })] }) }))] }));
|
|
75
75
|
}
|
|
@@ -33,5 +33,5 @@ function MicrocosmReincarnationPage({ title, subtitle, } = {}) {
|
|
|
33
33
|
const resolvedSubtitle = subtitle ?? t('subtitle', '2140 Protocol autonomous market making');
|
|
34
34
|
const { data: priceData, loading } = (0, auth_react_1.useMCCPrice)({ refetchInterval: 60000 });
|
|
35
35
|
const basePrice = priceData?.price ?? 0;
|
|
36
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-2 py-3 space-y-2 2xs:px-3 2xs:py-4 2xs:space-y-3 sm:px-6 sm:py-6 sm:space-y-6 font-mono", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-base 2xs:text-lg xs:text-xl sm:text-2xl md:text-3xl font-bold text-white tracking-wider truncate", children: resolvedTitle }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-400 mt-1", children: resolvedSubtitle })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 2xs:grid-cols-2 xs:grid-cols-2 sm:grid-cols-4 gap-1.5 2xs:gap-2 sm:gap-3", children: [(0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-neutral-400 tracking-wider mb-1 2xs:mb-2", children: "BASE PRICE" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold font-mono text-cyan-400 truncate", children: [loading ? '—' : formatNumber(basePrice, 4), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] 2xs:text-xs sm:text-sm font-normal text-neutral-500 ml-1", children: "USD" })] })] }), (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-neutral-400 tracking-wider mb-1 2xs:mb-2", children: "PROTOCOL" }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold font-mono text-white", children: "2140" }), (0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-neutral-500 mt-1", children: "EMA weighted" })] }), (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-neutral-400 tracking-wider mb-1 2xs:mb-2", children: "EPOCH" }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold font-mono text-white", children: "1h" }), (0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-neutral-500 mt-1", children: "Auto buyback" })] }), (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-neutral-400 tracking-wider mb-1 2xs:mb-2", children: "DEX" }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold font-mono text-cyan-400", children: "Raydium" }), (0, jsx_runtime_1.jsx)("div", { className: "text-[8px] 2xs:text-[9px] sm:text-[10px] text-neutral-500 mt-1", children: "CPMM pool" })] })] }), (0, jsx_runtime_1.jsx)(terminal_1.TerminalCard, { title: t('contractAddresses', 'Contract Addresses'), children: (0, jsx_runtime_1.jsxs)("div", { className: "space-y-2 2xs:space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-3 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-neutral-400 tracking-wider mb-1", children: "Reincarnation Pool PDA" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [(0, jsx_runtime_1.jsx)("code", { className: "text-[10px] 2xs:text-xs sm:text-sm text-cyan-400 min-w-0 flex-1", children: POOL_ADDRESS }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 2xs:gap-2 shrink-0", children: [(0, jsx_runtime_1.jsx)(CopyButton, { text: POOL_ADDRESS }), (0, jsx_runtime_1.jsx)("a", { href: `https://solscan.io/account/${POOL_ADDRESS}`, target: "_blank", rel: "noopener noreferrer", className: "text-neutral-400 hover:text-white text-xs", children: "\u2197" })] })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-1.5 2xs:gap-2 sm:gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-3 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-neutral-400 tracking-wider mb-1", children: t('usdtBalance', 'USDT Vault') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [(0, jsx_runtime_1.jsx)("code", { className: "text-[10px] 2xs:text-xs text-neutral-400 min-w-0 flex-1", children: USDT_VAULT }), (0, jsx_runtime_1.jsx)(CopyButton, { text: USDT_VAULT })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-white/5 border border-white/10 rounded-lg p-2 2xs:p-3 blockchain-sub-card min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-neutral-400 tracking-wider mb-1", children: t('usdcBalance', 'USDC Vault') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [(0, jsx_runtime_1.jsx)("code", { className: "text-[10px] 2xs:text-xs text-neutral-400 min-w-0 flex-1", children: USDC_VAULT }), (0, jsx_runtime_1.jsx)(CopyButton, { text: USDC_VAULT })] })] })] })] }) }), (0, jsx_runtime_1.jsx)(terminal_1.TerminalCard, { title: t('mechanism', 'Market Making Mechanism'), children: (0, jsx_runtime_1.jsxs)("div", { className: "text-xs 2xs:text-sm space-y-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "font-medium text-cyan-400 tracking-wider text-xs 2xs:text-sm sm:text-base", children: t('mechanism', 'Market Making Mechanism') }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 leading-relaxed text-xs 2xs:text-sm", children: t('mechanismDesc', 'The Reincarnation Pool is a Solana PDA-owned autonomous market maker. Every epoch (1 hour), it reads the CPMM spot price, updates an EMA-weighted oracle (weight 2140), and executes a permissionless buyback via CPMM swap. Proceeds flow to the Mining Vault for the next cycle of community mining.') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5 2xs:gap-2 mt-2 2xs:mt-3 text-[10px] 2xs:text-xs", children: [(0, jsx_runtime_1.jsx)("span", { className: "px-1.5 2xs:px-2 py-0.5 2xs:py-1 rounded bg-white/10 text-white whitespace-nowrap", children: "Raydium CPMM" }), (0, jsx_runtime_1.jsx)("span", { className: "px-1.5 2xs:px-2 py-0.5 2xs:py-1 rounded bg-cyan-400/20 text-cyan-400 whitespace-nowrap", children: "PDA Autonomous" }), (0, jsx_runtime_1.jsx)("span", { className: "px-1.5 2xs:px-2 py-0.5 2xs:py-1 rounded bg-cyan-400/20 text-cyan-400 whitespace-nowrap", children: "EMA Oracle" }), (0, jsx_runtime_1.jsx)("span", { className: "px-1.5 2xs:px-2 py-0.5 2xs:py-1 rounded bg-cyan-400/20 text-cyan-400 whitespace-nowrap", children: "Permissionless" })] })] }) })] }));
|
|
37
37
|
}
|
|
@@ -107,7 +107,7 @@ function MicrocosmRewardsPage({} = {}) {
|
|
|
107
107
|
return '-';
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-3 py-4 space-y-3 xs:px-4 xs:space-y-4 sm:px-6 sm:py-6 sm:space-y-6 font-mono", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between flex-wrap gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-lg sm:text-2xl font-bold text-white tracking-wider", children: t('title', 'Manager Rewards') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400", children: t('subtitle', 'Reward team members with your personal MCC') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => setShowSendDialog(true), className: "px-3 py-1.5 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-sm", children: t('sendReward', 'Send Reward') }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setShowBatchDialog(true), className: "px-3 py-1.5 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-white rounded text-sm", children: t('batchSend', 'Batch Send') })] })] }), error && ((0, jsx_runtime_1.jsx)("div", { className: "p-3 bg-red-900/20 border border-red-800 rounded text-sm text-red-300", children: error })), stats && ((0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4", children: [(0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-[#5EEAD4] tracking-widest uppercase mb-1", children: t('mccReceived', 'MCC Received') }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-white", children: Number(stats.total_received || 0).toFixed(2) })] }), (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-[#5EEAD4] tracking-widest uppercase mb-1", children: t('mccSent', 'MCC Sent') }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-cyan-400", children: Number(stats.total_sent || 0).toFixed(2) })] }), (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-[#5EEAD4] tracking-widest uppercase mb-1", children: t('receiveCount', 'Times Received') }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-white", children: stats.receive_count })] }), (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-[#5EEAD4] tracking-widest uppercase mb-1", children: t('sendCount', 'Times Sent') }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-white", children: stats.send_count })] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2 border-b border-neutral-800", children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => setTab('history'), className: `px-4 py-2 text-sm ${tab === 'history' ? 'text-white border-b-2 border-cyan-400' : 'text-neutral-400 hover:text-white'}`, children: t('historyTab', 'History') }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setTab('leaderboard'), className: `px-4 py-2 text-sm ${tab === 'leaderboard' ? 'text-white border-b-2 border-cyan-400' : 'text-neutral-400 hover:text-white'}`, children: t('leaderboardTab', 'Leaderboard') })] }), tab === 'history' && ((0, jsx_runtime_1.jsx)(terminal_1.TerminalCard, { title: t('rewardHistory', 'Reward History'), children: loading ? ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-8 text-neutral-500", children: t('loadingText', 'Loading...') })) : history.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-8 text-neutral-500", children: t('noRecords', 'No reward records') })) : ((0, jsx_runtime_1.jsx)("div", { className: "overflow-x-auto", children: (0, jsx_runtime_1.jsxs)("table", { className: "w-full text-sm", children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { className: "text-xs text-neutral-400 border-b border-neutral-800", children: [(0, jsx_runtime_1.jsx)("th", { className: "text-left py-2", children: t('time', 'Time') }), (0, jsx_runtime_1.jsx)("th", { className: "text-left py-2", children: t('sender', 'Sender') }), (0, jsx_runtime_1.jsx)("th", { className: "text-left py-2", children: t('recipient', 'Recipient') }), (0, jsx_runtime_1.jsx)("th", { className: "text-right py-2", children: t('amount', 'Amount') }), (0, jsx_runtime_1.jsx)("th", { className: "text-left py-2", children: t('reason', 'Reason') })] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: history.map(record => ((0, jsx_runtime_1.jsxs)("tr", { className: "border-b border-neutral-800", children: [(0, jsx_runtime_1.jsx)("td", { className: "py-2 text-xs text-neutral-500", children: formatDate(record.created_at) }), (0, jsx_runtime_1.jsx)("td", { className: "py-2 text-neutral-300", children: record.manager_email || record.manager_id }), (0, jsx_runtime_1.jsx)("td", { className: "py-2 text-neutral-300", children: record.recipient_email || record.recipient_id }), (0, jsx_runtime_1.jsxs)("td", { className: "py-2 text-right text-white", children: ["+", Number(record.amount || 0).toFixed(2), " MCC"] }), (0, jsx_runtime_1.jsx)("td", { className: "py-2 text-xs text-neutral-500", children: record.reason || '-' })] }, record.id))) })] }) })) })), tab === 'leaderboard' && ((0, jsx_runtime_1.jsxs)("div", { className: "grid md:grid-cols-2 gap-6", children: [(0, jsx_runtime_1.jsx)(terminal_1.TerminalCard, { title: t('topReceived', 'Most Received This Month'), children: topRecipients.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-4 text-neutral-500", children: t('noData', 'No data') })) : ((0, jsx_runtime_1.jsx)("div", { className: "space-y-3", children: topRecipients.map((entry, idx) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("span", { className: `w-6 h-6 flex items-center justify-center rounded text-xs ${idx < 3 ? 'bg-cyan-400/20 text-cyan-300' : 'bg-neutral-800 text-neutral-400'}`, children: idx + 1 }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-300", children: entry.email || entry.user_id })] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-white", children: [Number(entry.total_received || 0).toFixed(2), " MCC"] })] }, entry.user_id))) })) }), (0, jsx_runtime_1.jsx)(terminal_1.TerminalCard, { title: t('topSent', 'Most Sent This Month'), children: topSenders.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-4 text-neutral-500", children: t('noData', 'No data') })) : ((0, jsx_runtime_1.jsx)("div", { className: "space-y-3", children: topSenders.map((entry, idx) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("span", { className: `w-6 h-6 flex items-center justify-center rounded text-xs ${idx < 3 ? 'bg-cyan-400/20 text-cyan-300' : 'bg-neutral-800 text-neutral-400'}`, children: idx + 1 }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-300", children: entry.email || entry.user_id })] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-cyan-400", children: [Number(entry.total_sent || 0).toFixed(2), " MCC"] })] }, entry.user_id))) })) })] })), showSendDialog && ((0, jsx_runtime_1.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4", onClick: () => setShowSendDialog(false), children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg w-full max-w-md p-6 space-y-4", onClick: e => e.stopPropagation(), children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-white font-medium", children: t('sendSingleTitle', 'Send Single Reward') }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "text-xs text-[#5EEAD4] tracking-widest uppercase block mb-1", children: t('recipientId', 'Recipient ID') }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: singleReward.recipient_id, onChange: (e) => setSingleReward({ ...singleReward, recipient_id: e.target.value }), className: "w-full bg-neutral-800 border border-neutral-600 text-white rounded px-3 py-2 text-sm", placeholder: t('recipientPlaceholder', 'Enter user ID or email') })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "text-xs text-[#5EEAD4] tracking-widest uppercase block mb-1", children: t('rewardAmount', 'Reward Amount (MCC)') }), (0, jsx_runtime_1.jsx)("input", { type: "number", min: 1, max: 10000, value: singleReward.amount, onChange: (e) => setSingleReward({ ...singleReward, amount: e.target.value }), className: "w-full bg-neutral-800 border border-neutral-600 text-white rounded px-3 py-2 text-sm", placeholder: t('amountPlaceholder', 'Enter MCC amount') })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "text-xs text-[#5EEAD4] tracking-widest uppercase block mb-1", children: t('reasonLabel', 'Reason (optional)') }), (0, jsx_runtime_1.jsx)("textarea", { value: singleReward.reason, onChange: (e) => setSingleReward({ ...singleReward, reason: e.target.value }), rows: 2, className: "w-full bg-neutral-800 border border-neutral-600 text-white rounded px-3 py-2 text-sm" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => setShowSendDialog(false), className: "flex-1 px-3 py-2 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 rounded text-sm", children: t('cancel', 'Cancel') }), (0, jsx_runtime_1.jsx)("button", { onClick: handleSendReward, disabled: submitting, className: "flex-1 px-3 py-2 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-sm disabled:opacity-50", children: submitting ? t('loadingText', 'Loading...') : t('send', 'Send') })] })] }) })), showBatchDialog && ((0, jsx_runtime_1.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4", onClick: () => setShowBatchDialog(false), children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg w-full max-w-2xl p-6 space-y-4", onClick: e => e.stopPropagation(), children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-white font-medium", children: t('batchTitle', 'Batch Send Rewards') }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-2 max-h-96 overflow-y-auto", children: [batchRewards.map((r, i) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2 items-start", children: [(0, jsx_runtime_1.jsx)("input", { value: r.user_id, onChange: (e) => {
|
|
110
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-2 py-3 space-y-2 2xs:px-3 2xs:py-4 2xs:space-y-3 sm:px-6 sm:py-6 sm:space-y-6 font-mono", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between flex-wrap gap-2 2xs:gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0 flex-1", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-base 2xs:text-lg xs:text-xl sm:text-2xl md:text-3xl font-bold text-white tracking-wider truncate", children: t('title', 'Manager Rewards') }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-400", children: t('subtitle', 'Reward team members with your personal MCC') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-1.5 2xs:gap-2 shrink-0", children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => setShowSendDialog(true), className: "px-2 2xs:px-3 py-1 2xs:py-1.5 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-[11px] 2xs:text-xs sm:text-sm whitespace-nowrap", children: t('sendReward', 'Send Reward') }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setShowBatchDialog(true), className: "px-2 2xs:px-3 py-1 2xs:py-1.5 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-white rounded text-[11px] 2xs:text-xs sm:text-sm whitespace-nowrap", children: t('batchSend', 'Batch Send') })] })] }), error && ((0, jsx_runtime_1.jsx)("div", { className: "p-3 bg-red-900/20 border border-red-800 rounded text-sm text-red-300", children: error })), stats && ((0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-2 2xs:gap-3 sm:gap-4", children: [(0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-[#5EEAD4] tracking-widest uppercase mb-1 truncate", children: t('mccReceived', 'MCC Received') }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-white truncate", children: Number(stats.total_received || 0).toFixed(2) })] }), (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-[#5EEAD4] tracking-widest uppercase mb-1 truncate", children: t('mccSent', 'MCC Sent') }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-cyan-400 truncate", children: Number(stats.total_sent || 0).toFixed(2) })] }), (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-[#5EEAD4] tracking-widest uppercase mb-1 truncate", children: t('receiveCount', 'Times Received') }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-white truncate", children: stats.receive_count })] }), (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-[#5EEAD4] tracking-widest uppercase mb-1 truncate", children: t('sendCount', 'Times Sent') }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-white truncate", children: stats.send_count })] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2 border-b border-neutral-800", children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => setTab('history'), className: `px-2 2xs:px-3 sm:px-4 py-1.5 2xs:py-2 text-[11px] 2xs:text-xs sm:text-sm whitespace-nowrap ${tab === 'history' ? 'text-white border-b-2 border-cyan-400' : 'text-neutral-400 hover:text-white'}`, children: t('historyTab', 'History') }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setTab('leaderboard'), className: `px-2 2xs:px-3 sm:px-4 py-1.5 2xs:py-2 text-[11px] 2xs:text-xs sm:text-sm whitespace-nowrap ${tab === 'leaderboard' ? 'text-white border-b-2 border-cyan-400' : 'text-neutral-400 hover:text-white'}`, children: t('leaderboardTab', 'Leaderboard') })] }), tab === 'history' && ((0, jsx_runtime_1.jsx)(terminal_1.TerminalCard, { title: t('rewardHistory', 'Reward History'), children: loading ? ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-8 text-neutral-500", children: t('loadingText', 'Loading...') })) : history.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-8 text-neutral-500", children: t('noRecords', 'No reward records') })) : ((0, jsx_runtime_1.jsx)("div", { className: "overflow-x-auto", children: (0, jsx_runtime_1.jsxs)("table", { className: "w-full text-[11px] 2xs:text-xs sm:text-sm", children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { className: "text-[10px] 2xs:text-xs text-neutral-400 border-b border-neutral-800", children: [(0, jsx_runtime_1.jsx)("th", { className: "text-left py-2 hidden sm:table-cell", children: t('time', 'Time') }), (0, jsx_runtime_1.jsx)("th", { className: "text-left py-2 hidden xs:table-cell", children: t('sender', 'Sender') }), (0, jsx_runtime_1.jsx)("th", { className: "text-left py-2", children: t('recipient', 'Recipient') }), (0, jsx_runtime_1.jsx)("th", { className: "text-right py-2", children: t('amount', 'Amount') }), (0, jsx_runtime_1.jsx)("th", { className: "text-left py-2 hidden md:table-cell", children: t('reason', 'Reason') })] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: history.map(record => ((0, jsx_runtime_1.jsxs)("tr", { className: "border-b border-neutral-800", children: [(0, jsx_runtime_1.jsx)("td", { className: "py-2 text-[10px] 2xs:text-xs text-neutral-500 hidden sm:table-cell", children: formatDate(record.created_at) }), (0, jsx_runtime_1.jsx)("td", { className: "py-2 text-neutral-300 truncate max-w-[120px] hidden xs:table-cell", children: record.manager_email || record.manager_id }), (0, jsx_runtime_1.jsx)("td", { className: "py-2 text-neutral-300 truncate max-w-[140px]", children: record.recipient_email || record.recipient_id }), (0, jsx_runtime_1.jsxs)("td", { className: "py-2 text-right text-white whitespace-nowrap", children: ["+", Number(record.amount || 0).toFixed(2), " MCC"] }), (0, jsx_runtime_1.jsx)("td", { className: "py-2 text-[10px] 2xs:text-xs text-neutral-500 hidden md:table-cell", children: record.reason || '-' })] }, record.id))) })] }) })) })), tab === 'leaderboard' && ((0, jsx_runtime_1.jsxs)("div", { className: "grid md:grid-cols-2 gap-3 2xs:gap-4 sm:gap-6", children: [(0, jsx_runtime_1.jsx)(terminal_1.TerminalCard, { title: t('topReceived', 'Most Received This Month'), children: topRecipients.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-4 text-neutral-500", children: t('noData', 'No data') })) : ((0, jsx_runtime_1.jsx)("div", { className: "space-y-3", children: topRecipients.map((entry, idx) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 2xs:gap-3 min-w-0 flex-1", children: [(0, jsx_runtime_1.jsx)("span", { className: `w-5 h-5 2xs:w-6 2xs:h-6 flex items-center justify-center rounded text-[10px] 2xs:text-xs shrink-0 ${idx < 3 ? 'bg-cyan-400/20 text-cyan-300' : 'bg-neutral-800 text-neutral-400'}`, children: idx + 1 }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-300 text-[11px] 2xs:text-xs sm:text-sm truncate", children: entry.email || entry.user_id })] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-white text-[11px] 2xs:text-xs sm:text-sm whitespace-nowrap shrink-0", children: [Number(entry.total_received || 0).toFixed(2), " MCC"] })] }, entry.user_id))) })) }), (0, jsx_runtime_1.jsx)(terminal_1.TerminalCard, { title: t('topSent', 'Most Sent This Month'), children: topSenders.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-4 text-neutral-500", children: t('noData', 'No data') })) : ((0, jsx_runtime_1.jsx)("div", { className: "space-y-3", children: topSenders.map((entry, idx) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 2xs:gap-3 min-w-0 flex-1", children: [(0, jsx_runtime_1.jsx)("span", { className: `w-5 h-5 2xs:w-6 2xs:h-6 flex items-center justify-center rounded text-[10px] 2xs:text-xs shrink-0 ${idx < 3 ? 'bg-cyan-400/20 text-cyan-300' : 'bg-neutral-800 text-neutral-400'}`, children: idx + 1 }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-300 text-[11px] 2xs:text-xs sm:text-sm truncate", children: entry.email || entry.user_id })] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-cyan-400 text-[11px] 2xs:text-xs sm:text-sm whitespace-nowrap shrink-0", children: [Number(entry.total_sent || 0).toFixed(2), " MCC"] })] }, entry.user_id))) })) })] })), showSendDialog && ((0, jsx_runtime_1.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4", onClick: () => setShowSendDialog(false), children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg w-full max-w-md p-6 space-y-4", onClick: e => e.stopPropagation(), children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-white font-medium", children: t('sendSingleTitle', 'Send Single Reward') }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "text-xs text-[#5EEAD4] tracking-widest uppercase block mb-1", children: t('recipientId', 'Recipient ID') }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: singleReward.recipient_id, onChange: (e) => setSingleReward({ ...singleReward, recipient_id: e.target.value }), className: "w-full bg-neutral-800 border border-neutral-600 text-white rounded px-3 py-2 text-sm", placeholder: t('recipientPlaceholder', 'Enter user ID or email') })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "text-xs text-[#5EEAD4] tracking-widest uppercase block mb-1", children: t('rewardAmount', 'Reward Amount (MCC)') }), (0, jsx_runtime_1.jsx)("input", { type: "number", min: 1, max: 10000, value: singleReward.amount, onChange: (e) => setSingleReward({ ...singleReward, amount: e.target.value }), className: "w-full bg-neutral-800 border border-neutral-600 text-white rounded px-3 py-2 text-sm", placeholder: t('amountPlaceholder', 'Enter MCC amount') })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "text-xs text-[#5EEAD4] tracking-widest uppercase block mb-1", children: t('reasonLabel', 'Reason (optional)') }), (0, jsx_runtime_1.jsx)("textarea", { value: singleReward.reason, onChange: (e) => setSingleReward({ ...singleReward, reason: e.target.value }), rows: 2, className: "w-full bg-neutral-800 border border-neutral-600 text-white rounded px-3 py-2 text-sm" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => setShowSendDialog(false), className: "flex-1 px-3 py-2 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 rounded text-sm", children: t('cancel', 'Cancel') }), (0, jsx_runtime_1.jsx)("button", { onClick: handleSendReward, disabled: submitting, className: "flex-1 px-3 py-2 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-sm disabled:opacity-50", children: submitting ? t('loadingText', 'Loading...') : t('send', 'Send') })] })] }) })), showBatchDialog && ((0, jsx_runtime_1.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4", onClick: () => setShowBatchDialog(false), children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg w-full max-w-2xl p-6 space-y-4", onClick: e => e.stopPropagation(), children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-white font-medium", children: t('batchTitle', 'Batch Send Rewards') }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-2 max-h-96 overflow-y-auto", children: [batchRewards.map((r, i) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2 items-start", children: [(0, jsx_runtime_1.jsx)("input", { value: r.user_id, onChange: (e) => {
|
|
111
111
|
const next = [...batchRewards];
|
|
112
112
|
next[i] = { ...next[i], user_id: e.target.value };
|
|
113
113
|
setBatchRewards(next);
|
|
@@ -193,9 +193,9 @@ function MicrocosmStationListPage({ currentUid } = {}) {
|
|
|
193
193
|
setSubmitting(false);
|
|
194
194
|
}
|
|
195
195
|
};
|
|
196
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-
|
|
196
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-2 py-3 space-y-2 2xs:px-3 2xs:py-4 2xs:space-y-3 sm:px-6 sm:py-6 sm:space-y-6 font-mono", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-base 2xs:text-lg xs:text-xl sm:text-2xl md:text-3xl font-bold text-white tracking-wider truncate", children: t('title', 'Territory Management') }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs sm:text-sm text-neutral-400", children: t('subtitle', 'Manage territories, view KPI and vault balances') })] }), error && ((0, jsx_runtime_1.jsx)("div", { className: "p-3 bg-red-900/20 border border-red-800 rounded text-sm text-red-300", children: error })), summary && ((0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-2 2xs:gap-3 sm:gap-4", children: [(0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-[#5EEAD4] tracking-widest uppercase mb-1 truncate", children: "TOTAL STATIONS" }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-white truncate", children: summary.total_stations ?? 0 })] }), (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-[#5EEAD4] tracking-widest uppercase mb-1 truncate", children: "TOTAL MEMBERS" }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-cyan-400 truncate", children: summary.total_members ?? 0 })] }), (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-[#5EEAD4] tracking-widest uppercase mb-1 truncate", children: "VAULT MCD" }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-cyan-400 truncate", children: (summary.total_vault_mcd ?? 0).toLocaleString(undefined, { maximumFractionDigits: 0 }) })] }), (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[9px] 2xs:text-[10px] sm:text-xs text-[#5EEAD4] tracking-widest uppercase mb-1 truncate", children: "AVG KPI" }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg 2xs:text-xl xs:text-2xl sm:text-3xl font-bold text-white truncate", children: (summary.avg_kpi_score ?? 0).toFixed(1) })] })] })), (0, jsx_runtime_1.jsx)(terminal_1.TerminalCard, { children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col 2xs:flex-row gap-2 2xs:gap-3 sm:gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex gap-1.5 2xs:gap-2 flex-wrap", children: ['all', 'station', 'matrix', 'sector', 'system'].map(f => ((0, jsx_runtime_1.jsx)("button", { onClick: () => setFilter(f), className: `px-2 2xs:px-3 py-1 2xs:py-1.5 text-[11px] 2xs:text-xs sm:text-sm rounded transition-colors whitespace-nowrap ${filter === f ? 'bg-cyan-700 text-white' : 'bg-neutral-800 text-neutral-400 hover:bg-neutral-700 hover:text-white'}`, children: f === 'all' ? t('all', 'All') : t(`unitTypeLabels.${f}`, UNIT_LABELS[f]) }, f))) }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), placeholder: t('searchPlaceholder', 'Search territory name, path, location...'), className: "flex-1 min-w-0 bg-neutral-800 border border-neutral-600 text-white rounded px-2 2xs:px-3 py-1 2xs:py-1.5 text-[11px] 2xs:text-xs sm:text-sm focus:outline-none focus:border-cyan-400" })] }) }), loading ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-20", children: (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: t('loading', 'Loading units...') }) })) : filteredUnits.length === 0 ? ((0, jsx_runtime_1.jsx)(terminal_1.TerminalCard, { children: (0, jsx_runtime_1.jsx)("div", { className: "text-center py-8 text-neutral-500", children: t('noTerritories', 'no territories found') }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 2xs:grid-cols-2 lg:grid-cols-3 gap-2 2xs:gap-3 sm:gap-4", children: filteredUnits.map(unit => {
|
|
197
197
|
const metrics = unitDataCache[unit.unit_id];
|
|
198
|
-
return ((0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-start justify-between mb-3", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-semibold", children: unit.unit_name }), (0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-500", children: [t(`unitTypeLabels.${unit.unit_type}`, UNIT_LABELS[unit.unit_type]), " \u00B7 ", MAGISTRATE_TITLES[unit.unit_type]] }), unit.short_id && ((0, jsx_runtime_1.jsx)("div", { className: "text-xs font-mono text-cyan-400 mt-1", children: unit.short_id }))] }), canEditUnit(unit) && ((0, jsx_runtime_1.jsx)("button", { onClick: () => openEditDialog(unit), className: "text-xs px-2 py-1 border border-neutral-700 text-neutral-400 hover:text-white hover:bg-neutral-800 rounded", children: t('edit', 'Edit') }))] }), unit.description && ((0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 mb-3 line-clamp-2", children: unit.description })), metrics && ((0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-2 pt-3 border-t border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('members', 'Members') }), (0, jsx_runtime_1.jsxs)("div", { className: "text-sm text-white", children: [metrics.member_count, "/", metrics.max_capacity] })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('occupancy', 'Occupancy') }), (0, jsx_runtime_1.jsxs)("div", { className: "text-sm text-cyan-400", children: [(metrics.occupancy_rate * 100).toFixed(0), "%"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "col-span-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: "Vault MCD" }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm text-white", children: (metrics.vault_mcd ?? 0).toLocaleString(undefined, { maximumFractionDigits: 0 }) })] })] })), unit.image_status === 'pending' && ((0, jsx_runtime_1.jsx)("div", { className: "mt-2 text-xs text-yellow-400", children: t('reviewPending', 'Under review') }))] }, unit.unit_id));
|
|
198
|
+
return ((0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-start justify-between gap-2 mb-2 2xs:mb-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0 flex-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-semibold text-xs 2xs:text-sm sm:text-base truncate", children: unit.unit_name }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[10px] 2xs:text-xs text-neutral-500 truncate", children: [t(`unitTypeLabels.${unit.unit_type}`, UNIT_LABELS[unit.unit_type]), " \u00B7 ", MAGISTRATE_TITLES[unit.unit_type]] }), unit.short_id && ((0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs font-mono text-cyan-400 mt-1 truncate", children: unit.short_id }))] }), canEditUnit(unit) && ((0, jsx_runtime_1.jsx)("button", { onClick: () => openEditDialog(unit), className: "text-[10px] 2xs:text-xs px-1.5 2xs:px-2 py-0.5 2xs:py-1 border border-neutral-700 text-neutral-400 hover:text-white hover:bg-neutral-800 rounded whitespace-nowrap shrink-0", children: t('edit', 'Edit') }))] }), unit.description && ((0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-neutral-400 mb-2 2xs:mb-3 line-clamp-2", children: unit.description })), metrics && ((0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-2 pt-2 2xs:pt-3 border-t border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-neutral-500 truncate", children: t('members', 'Members') }), (0, jsx_runtime_1.jsxs)("div", { className: "text-xs 2xs:text-sm text-white truncate", children: [metrics.member_count, "/", metrics.max_capacity] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-neutral-500 truncate", children: t('occupancy', 'Occupancy') }), (0, jsx_runtime_1.jsxs)("div", { className: "text-xs 2xs:text-sm text-cyan-400 truncate", children: [(metrics.occupancy_rate * 100).toFixed(0), "%"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "col-span-2 min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] 2xs:text-xs text-neutral-500 truncate", children: "Vault MCD" }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs 2xs:text-sm text-white truncate", children: (metrics.vault_mcd ?? 0).toLocaleString(undefined, { maximumFractionDigits: 0 }) })] })] })), unit.image_status === 'pending' && ((0, jsx_runtime_1.jsx)("div", { className: "mt-2 text-xs text-yellow-400", children: t('reviewPending', 'Under review') }))] }, unit.unit_id));
|
|
199
199
|
}) })), editingUnit && ((0, jsx_runtime_1.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4", onClick: () => setEditingUnit(null), children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg w-full max-w-lg p-6 space-y-4 max-h-[90vh] overflow-y-auto", onClick: e => e.stopPropagation(), children: [(0, jsx_runtime_1.jsxs)("h3", { className: "text-white font-medium", children: [t('editTerritory', 'Edit Territory'), ": ", editingUnit.unit_name] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "text-xs text-[#5EEAD4] tracking-widest uppercase block mb-1", children: t('name', 'Name') }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: editFormData.unit_name, onChange: (e) => setEditFormData({ ...editFormData, unit_name: e.target.value }), className: "w-full bg-neutral-800 border border-neutral-600 text-white rounded px-3 py-2 text-sm" })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "text-xs text-[#5EEAD4] tracking-widest uppercase block mb-1", children: t('description', 'Description') }), (0, jsx_runtime_1.jsx)("textarea", { value: editFormData.description, onChange: (e) => setEditFormData({ ...editFormData, description: e.target.value }), rows: 4, className: "w-full bg-neutral-800 border border-neutral-600 text-white rounded px-3 py-2 text-sm" })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "text-xs text-[#5EEAD4] tracking-widest uppercase block mb-1", children: t('image', 'Image') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-3", children: [(imagePreview || editingUnit.image_url) ? ((0, jsx_runtime_1.jsx)("img", { src: imagePreview || editingUnit.image_url, alt: "", className: "w-24 h-24 rounded object-cover border border-neutral-700" })) : ((0, jsx_runtime_1.jsx)("div", { className: "w-24 h-24 rounded bg-neutral-800 border border-neutral-700 flex items-center justify-center text-xs text-neutral-500", children: t('noImage', 'No image') })), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 space-y-2", children: [(0, jsx_runtime_1.jsx)("input", { ref: fileInputRef, type: "file", accept: "image/jpeg,image/png,image/webp", onChange: handleFileSelect, className: "hidden" }), (0, jsx_runtime_1.jsx)("button", { onClick: () => fileInputRef.current?.click(), disabled: uploadingImage, className: "w-full px-3 py-1.5 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-white rounded text-sm", children: imageFile ? t('change', 'Change') : t('clickToUpload', 'Click to upload') }), imageFile && ((0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-500", children: [imageFile.name, " (", (imageFile.size / 1024).toFixed(1), "KB)"] })), editingUnit.image_status && ((0, jsx_runtime_1.jsx)("div", { className: `text-xs px-2 py-0.5 rounded inline-block ${editingUnit.image_status === 'approved'
|
|
200
200
|
? 'bg-green-900/30 text-green-400'
|
|
201
201
|
: editingUnit.image_status === 'rejected'
|