@microcosmmoney/portal-react 3.12.8 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +22 -0
- package/dist/index.js +48 -1
- package/dist/main-portal/components/auctions/AuctionsPage.d.ts +1 -0
- package/dist/main-portal/components/auctions/AuctionsPage.js +218 -0
- package/dist/main-portal/components/data/asset-stats.d.ts +1 -0
- package/dist/main-portal/components/data/asset-stats.js +33 -0
- package/dist/main-portal/components/data/charts/MCCSupplyChart.d.ts +7 -0
- package/dist/main-portal/components/data/charts/MCCSupplyChart.js +27 -0
- package/dist/main-portal/components/data/charts/MiningTrendChart.d.ts +7 -0
- package/dist/main-portal/components/data/charts/MiningTrendChart.js +39 -0
- package/dist/main-portal/components/data/charts/PriceChart.d.ts +5 -0
- package/dist/main-portal/components/data/charts/PriceChart.js +99 -0
- package/dist/main-portal/components/data/charts/TeamWalletChart.d.ts +7 -0
- package/dist/main-portal/components/data/charts/TeamWalletChart.js +33 -0
- package/dist/main-portal/components/data/charts/TerritoryProgressChart.d.ts +7 -0
- package/dist/main-portal/components/data/charts/TerritoryProgressChart.js +35 -0
- package/dist/main-portal/components/data/charts/UserLevelPieChart.d.ts +7 -0
- package/dist/main-portal/components/data/charts/UserLevelPieChart.js +34 -0
- package/dist/main-portal/components/data/charts/index.d.ts +5 -0
- package/dist/main-portal/components/data/charts/index.js +14 -0
- package/dist/main-portal/components/data/data-hero.d.ts +1 -0
- package/dist/main-portal/components/data/data-hero.js +81 -0
- package/dist/main-portal/components/data/mining-history-stats.d.ts +1 -0
- package/dist/main-portal/components/data/mining-history-stats.js +44 -0
- package/dist/main-portal/components/data/team-wallet-stats.d.ts +1 -0
- package/dist/main-portal/components/data/team-wallet-stats.js +34 -0
- package/dist/main-portal/components/data/territory-stats.d.ts +1 -0
- package/dist/main-portal/components/data/territory-stats.js +48 -0
- package/dist/main-portal/components/data/user-level-stats.d.ts +1 -0
- package/dist/main-portal/components/data/user-level-stats.js +36 -0
- package/dist/main-portal/components/fragment/FragmentPage.d.ts +1 -0
- package/dist/main-portal/components/fragment/FragmentPage.js +13 -0
- package/dist/main-portal/components/income/ManagerIncomePage.d.ts +1 -0
- package/dist/main-portal/components/income/ManagerIncomePage.js +147 -0
- package/dist/main-portal/components/layout/AppSidebar.d.ts +3 -0
- package/dist/main-portal/components/layout/AppSidebar.js +88 -0
- package/dist/main-portal/components/layout/DashboardHeader.d.ts +1 -0
- package/dist/main-portal/components/layout/DashboardHeader.js +121 -0
- package/dist/main-portal/components/layout/LocaleSwitcher.d.ts +1 -0
- package/dist/main-portal/components/layout/LocaleSwitcher.js +30 -0
- package/dist/main-portal/components/layout/MainFooter.d.ts +2 -0
- package/dist/main-portal/components/layout/MainFooter.js +50 -0
- package/dist/main-portal/components/layout/ShadcnNavbar.d.ts +1 -0
- package/dist/main-portal/components/layout/ShadcnNavbar.js +155 -0
- package/dist/main-portal/components/layout/TerminalSidebar.d.ts +1 -0
- package/dist/main-portal/components/layout/TerminalSidebar.js +110 -0
- package/dist/main-portal/components/lending/LendingPage.d.ts +1 -0
- package/dist/main-portal/components/lending/LendingPage.js +20 -0
- package/dist/main-portal/components/mcd/MCDPage.d.ts +1 -0
- package/dist/main-portal/components/mcd/MCDPage.js +125 -0
- package/dist/main-portal/components/messages/MessagesPage.d.ts +1 -0
- package/dist/main-portal/components/messages/MessagesPage.js +13 -0
- package/dist/main-portal/components/mining/MiningDistributionHistory.d.ts +11 -0
- package/dist/main-portal/components/mining/MiningDistributionHistory.js +84 -0
- package/dist/main-portal/components/mining/MiningModal.d.ts +12 -0
- package/dist/main-portal/components/mining/MiningModal.js +302 -0
- package/dist/main-portal/components/mining/MiningPage.d.ts +1 -0
- package/dist/main-portal/components/mining/MiningPage.js +237 -0
- package/dist/main-portal/components/mining/index.d.ts +1 -0
- package/dist/main-portal/components/mining/index.js +6 -0
- package/dist/main-portal/components/notifications/NotificationsPage.d.ts +1 -0
- package/dist/main-portal/components/notifications/NotificationsPage.js +13 -0
- package/dist/main-portal/components/organization/OrganizationPage.d.ts +1 -0
- package/dist/main-portal/components/organization/OrganizationPage.js +235 -0
- package/dist/main-portal/components/organization/connection-line.d.ts +12 -0
- package/dist/main-portal/components/organization/connection-line.js +38 -0
- package/dist/main-portal/components/organization/diagram-node.d.ts +17 -0
- package/dist/main-portal/components/organization/diagram-node.js +105 -0
- package/dist/main-portal/components/organization/system-panel.d.ts +11 -0
- package/dist/main-portal/components/organization/system-panel.js +72 -0
- package/dist/main-portal/components/profile/EmailChangeCard.d.ts +1 -0
- package/dist/main-portal/components/profile/EmailChangeCard.js +58 -0
- package/dist/main-portal/components/profile/ProfilePage.d.ts +1 -0
- package/dist/main-portal/components/profile/ProfilePage.js +263 -0
- package/dist/main-portal/components/profile/TwoFactorSettings.d.ts +1 -0
- package/dist/main-portal/components/profile/TwoFactorSettings.js +99 -0
- package/dist/main-portal/components/providers/ClientProviders.d.ts +6 -0
- package/dist/main-portal/components/providers/ClientProviders.js +17 -0
- package/dist/main-portal/components/providers/SolanaWalletProvider.d.ts +7 -0
- package/dist/main-portal/components/providers/SolanaWalletProvider.js +17 -0
- package/dist/main-portal/components/providers/theme-provider.d.ts +5 -0
- package/dist/main-portal/components/providers/theme-provider.js +10 -0
- package/dist/main-portal/components/queue/QueueStatusPage.d.ts +1 -0
- package/dist/main-portal/components/queue/QueueStatusPage.js +245 -0
- package/dist/main-portal/components/reincarnation/ReincarnationPage.d.ts +1 -0
- package/dist/main-portal/components/reincarnation/ReincarnationPage.js +87 -0
- package/dist/main-portal/components/resources/mcc-stats-section.d.ts +1 -0
- package/dist/main-portal/components/resources/mcc-stats-section.js +199 -0
- package/dist/main-portal/components/resources/mcd-stats-section.d.ts +1 -0
- package/dist/main-portal/components/resources/mcd-stats-section.js +76 -0
- package/dist/main-portal/components/resources/minting-entry-section.d.ts +1 -0
- package/dist/main-portal/components/resources/minting-entry-section.js +70 -0
- package/dist/main-portal/components/resources/public-mining-modal.d.ts +7 -0
- package/dist/main-portal/components/resources/public-mining-modal.js +239 -0
- package/dist/main-portal/components/resources/recycle-pool-section.d.ts +1 -0
- package/dist/main-portal/components/resources/recycle-pool-section.js +82 -0
- package/dist/main-portal/components/resources/registration-prompt.d.ts +8 -0
- package/dist/main-portal/components/resources/registration-prompt.js +13 -0
- package/dist/main-portal/components/rewards/RewardsPage.d.ts +1 -0
- package/dist/main-portal/components/rewards/RewardsPage.js +149 -0
- package/dist/main-portal/components/security/domain-verification-bar.d.ts +1 -0
- package/dist/main-portal/components/security/domain-verification-bar.js +32 -0
- package/dist/main-portal/components/stations/StationDetailPage.d.ts +5 -0
- package/dist/main-portal/components/stations/StationDetailPage.js +232 -0
- package/dist/main-portal/components/stations/StationIncomeChart.d.ts +11 -0
- package/dist/main-portal/components/stations/StationIncomeChart.js +57 -0
- package/dist/main-portal/components/stations/StationKPIHistory.d.ts +1 -0
- package/dist/main-portal/components/stations/StationKPIHistory.js +7 -0
- package/dist/main-portal/components/stations/StationListPage.d.ts +1 -0
- package/dist/main-portal/components/stations/StationListPage.js +341 -0
- package/dist/main-portal/components/stations/StationMemberRanking.d.ts +13 -0
- package/dist/main-portal/components/stations/StationMemberRanking.js +64 -0
- package/dist/main-portal/components/stations/StationSummaryCards.d.ts +13 -0
- package/dist/main-portal/components/stations/StationSummaryCards.js +30 -0
- package/dist/main-portal/components/stations/StationsPage.d.ts +1 -0
- package/dist/main-portal/components/stations/StationsPage.js +239 -0
- package/dist/main-portal/components/territory/TerritoryNFTBrowser.d.ts +1 -0
- package/dist/main-portal/components/territory/TerritoryNFTBrowser.js +147 -0
- package/dist/main-portal/components/ui/accordion.d.ts +7 -0
- package/dist/main-portal/components/ui/accordion.js +57 -0
- package/dist/main-portal/components/ui/alert-dialog.d.ts +14 -0
- package/dist/main-portal/components/ui/alert-dialog.js +85 -0
- package/dist/main-portal/components/ui/alert.d.ts +9 -0
- package/dist/main-portal/components/ui/alert.js +28 -0
- package/dist/main-portal/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/main-portal/components/ui/aspect-ratio.js +43 -0
- package/dist/main-portal/components/ui/avatar.d.ts +6 -0
- package/dist/main-portal/components/ui/avatar.js +52 -0
- package/dist/main-portal/components/ui/badge.d.ts +9 -0
- package/dist/main-portal/components/ui/badge.js +26 -0
- package/dist/main-portal/components/ui/breadcrumb.d.ts +11 -0
- package/dist/main-portal/components/ui/breadcrumb.js +35 -0
- package/dist/main-portal/components/ui/button-group.d.ts +11 -0
- package/dist/main-portal/components/ui/button-group.js +34 -0
- package/dist/main-portal/components/ui/button.d.ts +10 -0
- package/dist/main-portal/components/ui/button.js +35 -0
- package/dist/main-portal/components/ui/calendar.d.ts +8 -0
- package/dist/main-portal/components/ui/calendar.js +111 -0
- package/dist/main-portal/components/ui/card.d.ts +17 -0
- package/dist/main-portal/components/ui/card.js +41 -0
- package/dist/main-portal/components/ui/carousel.d.ts +19 -0
- package/dist/main-portal/components/ui/carousel.js +134 -0
- package/dist/main-portal/components/ui/chart.d.ts +40 -0
- package/dist/main-portal/components/ui/chart.js +168 -0
- package/dist/main-portal/components/ui/checkbox.d.ts +4 -0
- package/dist/main-portal/components/ui/checkbox.js +45 -0
- package/dist/main-portal/components/ui/collapsible.d.ts +5 -0
- package/dist/main-portal/components/ui/collapsible.js +51 -0
- package/dist/main-portal/components/ui/command.d.ts +18 -0
- package/dist/main-portal/components/ui/command.js +45 -0
- package/dist/main-portal/components/ui/context-menu.d.ts +25 -0
- package/dist/main-portal/components/ui/context-menu.js +101 -0
- package/dist/main-portal/components/ui/dialog.d.ts +15 -0
- package/dist/main-portal/components/ui/dialog.js +81 -0
- package/dist/main-portal/components/ui/drawer.d.ts +13 -0
- package/dist/main-portal/components/ui/drawer.js +47 -0
- package/dist/main-portal/components/ui/dropdown-menu.d.ts +25 -0
- package/dist/main-portal/components/ui/dropdown-menu.js +101 -0
- package/dist/main-portal/components/ui/empty.d.ts +11 -0
- package/dist/main-portal/components/ui/empty.js +41 -0
- package/dist/main-portal/components/ui/field.d.ts +24 -0
- package/dist/main-portal/components/ui/field.js +85 -0
- package/dist/main-portal/components/ui/form.d.ts +24 -0
- package/dist/main-portal/components/ui/form.js +103 -0
- package/dist/main-portal/components/ui/hover-avatar.d.ts +10 -0
- package/dist/main-portal/components/ui/hover-avatar.js +70 -0
- package/dist/main-portal/components/ui/hover-card.d.ts +6 -0
- package/dist/main-portal/components/ui/hover-card.js +52 -0
- package/dist/main-portal/components/ui/input-group.d.ts +15 -0
- package/dist/main-portal/components/ui/input-group.js +65 -0
- package/dist/main-portal/components/ui/input-otp.d.ts +11 -0
- package/dist/main-portal/components/ui/input-otp.js +60 -0
- package/dist/main-portal/components/ui/input.d.ts +3 -0
- package/dist/main-portal/components/ui/input.js +8 -0
- package/dist/main-portal/components/ui/item.d.ts +23 -0
- package/dist/main-portal/components/ui/item.js +77 -0
- package/dist/main-portal/components/ui/kbd.d.ts +3 -0
- package/dist/main-portal/components/ui/kbd.js +13 -0
- package/dist/main-portal/components/ui/label.d.ts +4 -0
- package/dist/main-portal/components/ui/label.js +44 -0
- package/dist/main-portal/components/ui/menubar.d.ts +26 -0
- package/dist/main-portal/components/ui/menubar.js +105 -0
- package/dist/main-portal/components/ui/navigation-menu.d.ts +14 -0
- package/dist/main-portal/components/ui/navigation-menu.js +75 -0
- package/dist/main-portal/components/ui/pagination.d.ts +13 -0
- package/dist/main-portal/components/ui/pagination.js +37 -0
- package/dist/main-portal/components/ui/popover.d.ts +7 -0
- package/dist/main-portal/components/ui/popover.js +56 -0
- package/dist/main-portal/components/ui/progress.d.ts +4 -0
- package/dist/main-portal/components/ui/progress.js +44 -0
- package/dist/main-portal/components/ui/radio-group.d.ts +5 -0
- package/dist/main-portal/components/ui/radio-group.js +49 -0
- package/dist/main-portal/components/ui/resizable.d.ts +8 -0
- package/dist/main-portal/components/ui/resizable.js +53 -0
- package/dist/main-portal/components/ui/scroll-area.d.ts +5 -0
- package/dist/main-portal/components/ui/scroll-area.js +50 -0
- package/dist/main-portal/components/ui/select.d.ts +15 -0
- package/dist/main-portal/components/ui/select.js +83 -0
- package/dist/main-portal/components/ui/separator.d.ts +4 -0
- package/dist/main-portal/components/ui/separator.js +44 -0
- package/dist/main-portal/components/ui/sheet.d.ts +13 -0
- package/dist/main-portal/components/ui/sheet.js +83 -0
- package/dist/main-portal/components/ui/sidebar.d.ts +69 -0
- package/dist/main-portal/components/ui/sidebar.js +258 -0
- package/dist/main-portal/components/ui/skeleton.d.ts +2 -0
- package/dist/main-portal/components/ui/skeleton.js +9 -0
- package/dist/main-portal/components/ui/slider.d.ts +4 -0
- package/dist/main-portal/components/ui/slider.js +50 -0
- package/dist/main-portal/components/ui/sonner.d.ts +3 -0
- package/dist/main-portal/components/ui/sonner.js +17 -0
- package/dist/main-portal/components/ui/spinner.d.ts +2 -0
- package/dist/main-portal/components/ui/spinner.js +10 -0
- package/dist/main-portal/components/ui/switch.d.ts +4 -0
- package/dist/main-portal/components/ui/switch.js +44 -0
- package/dist/main-portal/components/ui/table.d.ts +10 -0
- package/dist/main-portal/components/ui/table.js +38 -0
- package/dist/main-portal/components/ui/tabs.d.ts +7 -0
- package/dist/main-portal/components/ui/tabs.js +53 -0
- package/dist/main-portal/components/ui/terminal.d.ts +49 -0
- package/dist/main-portal/components/ui/terminal.js +56 -0
- package/dist/main-portal/components/ui/textarea.d.ts +3 -0
- package/dist/main-portal/components/ui/textarea.js +8 -0
- package/dist/main-portal/components/ui/time-remaining.d.ts +54 -0
- package/dist/main-portal/components/ui/time-remaining.js +223 -0
- package/dist/main-portal/components/ui/toast.d.ts +15 -0
- package/dist/main-portal/components/ui/toast.js +77 -0
- package/dist/main-portal/components/ui/toaster.d.ts +1 -0
- package/dist/main-portal/components/ui/toaster.js +14 -0
- package/dist/main-portal/components/ui/toggle-group.d.ts +7 -0
- package/dist/main-portal/components/ui/toggle-group.js +58 -0
- package/dist/main-portal/components/ui/toggle.d.ts +9 -0
- package/dist/main-portal/components/ui/toggle.js +64 -0
- package/dist/main-portal/components/ui/tooltip.d.ts +7 -0
- package/dist/main-portal/components/ui/tooltip.js +56 -0
- package/dist/main-portal/components/ui/use-mobile.d.ts +1 -0
- package/dist/main-portal/components/ui/use-mobile.js +53 -0
- package/dist/main-portal/components/voting/VotingPage.d.ts +1 -0
- package/dist/main-portal/components/voting/VotingPage.js +14 -0
- package/dist/main-portal/components/wallet/MCCHistory.d.ts +9 -0
- package/dist/main-portal/components/wallet/MCCHistory.js +100 -0
- package/dist/main-portal/components/wallet/WalletManagement.d.ts +5 -0
- package/dist/main-portal/components/wallet/WalletManagement.js +144 -0
- package/dist/main-portal/components/wallet/WalletPage.d.ts +1 -0
- package/dist/main-portal/components/wallet/WalletPage.js +130 -0
- package/dist/main-portal/config/menu-config.d.ts +22 -0
- package/dist/main-portal/config/menu-config.js +167 -0
- package/dist/main-portal/contexts/MCCPriceContext.d.ts +38 -0
- package/dist/main-portal/contexts/MCCPriceContext.js +70 -0
- package/dist/main-portal/contexts/WalletContext.d.ts +48 -0
- package/dist/main-portal/contexts/WalletContext.js +94 -0
- package/dist/main-portal/hooks/index.d.ts +4 -0
- package/dist/main-portal/hooks/index.js +11 -0
- package/dist/main-portal/hooks/use-breakpoint.d.ts +45 -0
- package/dist/main-portal/hooks/use-breakpoint.js +91 -0
- package/dist/main-portal/hooks/use-mobile.d.ts +1 -0
- package/dist/main-portal/hooks/use-mobile.js +55 -0
- package/dist/main-portal/hooks/use-toast.d.ts +44 -0
- package/dist/main-portal/hooks/use-toast.js +164 -0
- package/dist/main-portal/hooks/useAuth.d.ts +30 -0
- package/dist/main-portal/hooks/useAuth.js +135 -0
- package/dist/main-portal/hooks/useMCC.d.ts +26 -0
- package/dist/main-portal/hooks/useMCC.js +148 -0
- package/dist/main-portal/hooks/useMCD.d.ts +17 -0
- package/dist/main-portal/hooks/useMCD.js +114 -0
- package/dist/main-portal/hooks/useMarketData.d.ts +9 -0
- package/dist/main-portal/hooks/useMarketData.js +32 -0
- package/dist/main-portal/hooks/useMultiWalletBalance.d.ts +31 -0
- package/dist/main-portal/hooks/useMultiWalletBalance.js +65 -0
- package/dist/main-portal/hooks/usePriceHistory.d.ts +9 -0
- package/dist/main-portal/hooks/usePriceHistory.js +36 -0
- package/dist/main-portal/hooks/useSolanaBalance.d.ts +21 -0
- package/dist/main-portal/hooks/useSolanaBalance.js +58 -0
- package/dist/main-portal/hooks/useSpeechRecognition.d.ts +6 -0
- package/dist/main-portal/hooks/useSpeechRecognition.js +82 -0
- package/dist/main-portal/hooks/useStats.d.ts +131 -0
- package/dist/main-portal/hooks/useStats.js +161 -0
- package/dist/main-portal/hooks/useStrategies.d.ts +134 -0
- package/dist/main-portal/hooks/useStrategies.js +28 -0
- package/dist/main-portal/hooks/useUserRank.d.ts +16 -0
- package/dist/main-portal/hooks/useUserRank.js +61 -0
- package/dist/main-portal/hooks/useWalletTokenBalances.d.ts +29 -0
- package/dist/main-portal/hooks/useWalletTokenBalances.js +106 -0
- package/dist/main-portal/i18n/navigation.d.ts +341 -0
- package/dist/main-portal/i18n/navigation.js +7 -0
- package/dist/main-portal/i18n/request.d.ts +2 -0
- package/dist/main-portal/i18n/request.js +47 -0
- package/dist/main-portal/i18n/routing.d.ts +18 -0
- package/dist/main-portal/i18n/routing.js +10 -0
- package/dist/main-portal/lib/ai-chat-config.d.ts +8 -0
- package/dist/main-portal/lib/ai-chat-config.js +144 -0
- package/dist/main-portal/lib/analytics/hooks.d.ts +139 -0
- package/dist/main-portal/lib/analytics/hooks.js +277 -0
- package/dist/main-portal/lib/analytics/index.d.ts +2 -0
- package/dist/main-portal/lib/analytics/index.js +19 -0
- package/dist/main-portal/lib/analytics/types.d.ts +611 -0
- package/dist/main-portal/lib/analytics/types.js +2 -0
- package/dist/main-portal/lib/api/account.d.ts +39 -0
- package/dist/main-portal/lib/api/account.js +86 -0
- package/dist/main-portal/lib/api/admin.d.ts +78 -0
- package/dist/main-portal/lib/api/admin.js +195 -0
- package/dist/main-portal/lib/api/analytics.d.ts +217 -0
- package/dist/main-portal/lib/api/analytics.js +55 -0
- package/dist/main-portal/lib/api/blockchain.d.ts +178 -0
- package/dist/main-portal/lib/api/blockchain.js +302 -0
- package/dist/main-portal/lib/api/core.d.ts +3 -0
- package/dist/main-portal/lib/api/core.js +47 -0
- package/dist/main-portal/lib/api/dexscreener.d.ts +126 -0
- package/dist/main-portal/lib/api/dexscreener.js +139 -0
- package/dist/main-portal/lib/api/geckoterminal.d.ts +10 -0
- package/dist/main-portal/lib/api/geckoterminal.js +43 -0
- package/dist/main-portal/lib/api/index.d.ts +16 -0
- package/dist/main-portal/lib/api/index.js +230 -0
- package/dist/main-portal/lib/api/mcc-holders.d.ts +130 -0
- package/dist/main-portal/lib/api/mcc-holders.js +47 -0
- package/dist/main-portal/lib/api/org-service-proxy.d.ts +7 -0
- package/dist/main-portal/lib/api/org-service-proxy.js +55 -0
- package/dist/main-portal/lib/api/services/ai.d.ts +139 -0
- package/dist/main-portal/lib/api/services/ai.js +214 -0
- package/dist/main-portal/lib/api/services/finance.d.ts +37 -0
- package/dist/main-portal/lib/api/services/finance.js +144 -0
- package/dist/main-portal/lib/api/services/index.d.ts +5 -0
- package/dist/main-portal/lib/api/services/index.js +21 -0
- package/dist/main-portal/lib/api/services/mining.d.ts +68 -0
- package/dist/main-portal/lib/api/services/mining.js +76 -0
- package/dist/main-portal/lib/api/services/organization.d.ts +161 -0
- package/dist/main-portal/lib/api/services/organization.js +139 -0
- package/dist/main-portal/lib/api/services/user.d.ts +90 -0
- package/dist/main-portal/lib/api/services/user.js +78 -0
- package/dist/main-portal/lib/api/services.d.ts +1 -0
- package/dist/main-portal/lib/api/services.js +17 -0
- package/dist/main-portal/lib/api/strategies.d.ts +101 -0
- package/dist/main-portal/lib/api/strategies.js +87 -0
- package/dist/main-portal/lib/api-service.d.ts +1 -0
- package/dist/main-portal/lib/api-service.js +18 -0
- package/dist/main-portal/lib/auth-service.d.ts +65 -0
- package/dist/main-portal/lib/auth-service.js +382 -0
- package/dist/main-portal/lib/config/mainstream-tokens.d.ts +13 -0
- package/dist/main-portal/lib/config/mainstream-tokens.js +88 -0
- package/dist/main-portal/lib/docs-data.d.ts +36 -0
- package/dist/main-portal/lib/docs-data.js +108 -0
- package/dist/main-portal/lib/exchanges/config.d.ts +34 -0
- package/dist/main-portal/lib/exchanges/config.js +185 -0
- package/dist/main-portal/lib/exchanges/hooks/index.d.ts +5 -0
- package/dist/main-portal/lib/exchanges/hooks/index.js +10 -0
- package/dist/main-portal/lib/exchanges/hooks/useBinanceData.d.ts +15 -0
- package/dist/main-portal/lib/exchanges/hooks/useBinanceData.js +216 -0
- package/dist/main-portal/lib/exchanges/hooks/useBinanceDialogs.d.ts +32 -0
- package/dist/main-portal/lib/exchanges/hooks/useBinanceDialogs.js +395 -0
- package/dist/main-portal/lib/exchanges/hooks/useUserExchanges.d.ts +15 -0
- package/dist/main-portal/lib/exchanges/hooks/useUserExchanges.js +51 -0
- package/dist/main-portal/lib/exchanges/index.d.ts +4 -0
- package/dist/main-portal/lib/exchanges/index.js +21 -0
- package/dist/main-portal/lib/exchanges/types.d.ts +102 -0
- package/dist/main-portal/lib/exchanges/types.js +2 -0
- package/dist/main-portal/lib/exchanges/utils.d.ts +1 -0
- package/dist/main-portal/lib/exchanges/utils.js +10 -0
- package/dist/main-portal/lib/gcp-secrets.d.ts +7 -0
- package/dist/main-portal/lib/gcp-secrets.js +45 -0
- package/dist/main-portal/lib/mockWallet.d.ts +130 -0
- package/dist/main-portal/lib/mockWallet.js +284 -0
- package/dist/main-portal/lib/oauth-config.d.ts +12 -0
- package/dist/main-portal/lib/oauth-config.js +48 -0
- package/dist/main-portal/lib/order-id-generator.d.ts +19 -0
- package/dist/main-portal/lib/order-id-generator.js +97 -0
- package/dist/main-portal/lib/solana/reincarnation-client.d.ts +28 -0
- package/dist/main-portal/lib/solana/reincarnation-client.js +39 -0
- package/dist/main-portal/lib/solana/solana-pay.d.ts +31 -0
- package/dist/main-portal/lib/solana/solana-pay.js +85 -0
- package/dist/main-portal/lib/strategy/defaults.d.ts +2 -0
- package/dist/main-portal/lib/strategy/defaults.js +58 -0
- package/dist/main-portal/lib/strategy/index.d.ts +3 -0
- package/dist/main-portal/lib/strategy/index.js +20 -0
- package/dist/main-portal/lib/strategy/tooltips.d.ts +1 -0
- package/dist/main-portal/lib/strategy/tooltips.js +50 -0
- package/dist/main-portal/lib/strategy/types.d.ts +74 -0
- package/dist/main-portal/lib/strategy/types.js +2 -0
- package/dist/main-portal/lib/types/ai.types.d.ts +111 -0
- package/dist/main-portal/lib/types/ai.types.js +2 -0
- package/dist/main-portal/lib/types/api.d.ts +5 -0
- package/dist/main-portal/lib/types/api.js +21 -0
- package/dist/main-portal/lib/types/common.types.d.ts +168 -0
- package/dist/main-portal/lib/types/common.types.js +24 -0
- package/dist/main-portal/lib/types/finance.types.d.ts +267 -0
- package/dist/main-portal/lib/types/finance.types.js +2 -0
- package/dist/main-portal/lib/types/protocol.types.d.ts +216 -0
- package/dist/main-portal/lib/types/protocol.types.js +2 -0
- package/dist/main-portal/lib/types/user.types.d.ts +243 -0
- package/dist/main-portal/lib/types/user.types.js +12 -0
- package/dist/main-portal/lib/utils/territoryId.d.ts +75 -0
- package/dist/main-portal/lib/utils/territoryId.js +241 -0
- package/dist/main-portal/lib/utils.d.ts +4 -0
- package/dist/main-portal/lib/utils.js +24 -0
- package/dist/main-portal/lib/wallet-auth/api.d.ts +13 -0
- package/dist/main-portal/lib/wallet-auth/api.js +132 -0
- package/dist/main-portal/lib/wallet-auth/types.d.ts +87 -0
- package/dist/main-portal/lib/wallet-auth/types.js +58 -0
- package/package.json +55 -5
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
"use client";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.Navbar = Navbar;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const navigation_1 = require("../../i18n/navigation");
|
|
9
|
+
const lucide_react_1 = require("lucide-react");
|
|
10
|
+
const utils_1 = require("../../lib/utils");
|
|
11
|
+
const useAuth_1 = require("../../hooks/useAuth");
|
|
12
|
+
const auth_service_1 = require("../../lib/auth-service");
|
|
13
|
+
const next_intl_1 = require("next-intl");
|
|
14
|
+
const LocaleSwitcher_1 = require("./LocaleSwitcher");
|
|
15
|
+
const hover_avatar_1 = require("../ui/hover-avatar");
|
|
16
|
+
function TitanLabel() {
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)("span", { className: "tracking-wide", children: ["T", (0, jsx_runtime_1.jsx)("span", { className: "text-green-400 font-bold", children: "I" }), "TAN"] }));
|
|
18
|
+
}
|
|
19
|
+
function GameLabel() {
|
|
20
|
+
return ((0, jsx_runtime_1.jsxs)("span", { className: "tracking-wide", children: ["G", (0, jsx_runtime_1.jsx)("span", { className: "text-green-400 font-bold", children: "A" }), "ME"] }));
|
|
21
|
+
}
|
|
22
|
+
function Navbar() {
|
|
23
|
+
const [mobileMenuOpen, setMobileMenuOpen] = (0, react_1.useState)(false);
|
|
24
|
+
const [showBlockchainMenu, setShowBlockchainMenu] = (0, react_1.useState)(false);
|
|
25
|
+
const [showDeveloperMenu, setShowDeveloperMenu] = (0, react_1.useState)(false);
|
|
26
|
+
const [showUserMenu, setShowUserMenu] = (0, react_1.useState)(false);
|
|
27
|
+
const [showGameMenu, setShowGameMenu] = (0, react_1.useState)(false);
|
|
28
|
+
const [mobileBlockchainExpanded, setMobileBlockchainExpanded] = (0, react_1.useState)(false);
|
|
29
|
+
const [mobileDevExpanded, setMobileDevExpanded] = (0, react_1.useState)(false);
|
|
30
|
+
const [mobileGameExpanded, setMobileGameExpanded] = (0, react_1.useState)(false);
|
|
31
|
+
const blockchainMenuTimeoutRef = (0, react_1.useRef)(null);
|
|
32
|
+
const developerMenuTimeoutRef = (0, react_1.useRef)(null);
|
|
33
|
+
const userMenuTimeoutRef = (0, react_1.useRef)(null);
|
|
34
|
+
const gameMenuTimeoutRef = (0, react_1.useRef)(null);
|
|
35
|
+
const { user, userInfo, loading } = (0, useAuth_1.useAuth)();
|
|
36
|
+
const t = (0, next_intl_1.useTranslations)("nav");
|
|
37
|
+
const tc = (0, next_intl_1.useTranslations)("common");
|
|
38
|
+
const blockchainSubItems = [
|
|
39
|
+
{ label: t("quickMining"), href: "https://m.microcosm.money", icon: lucide_react_1.Pickaxe, description: t("quickMiningDesc"), external: true },
|
|
40
|
+
{ label: t("market"), href: "/market", icon: lucide_react_1.TrendingUp, description: t("marketDesc") },
|
|
41
|
+
{ label: t("community"), href: "/community", icon: lucide_react_1.Users, description: t("communityDesc") },
|
|
42
|
+
{ label: t("mccEconomics"), href: "/blockchain/economics", icon: lucide_react_1.Coins, description: t("mccEconomicsDesc") },
|
|
43
|
+
];
|
|
44
|
+
const developerSubItems = [
|
|
45
|
+
{ label: t("techDocs"), href: "/developers/api", icon: lucide_react_1.FileText, description: t("techDocsDesc") },
|
|
46
|
+
{ label: t("projectDev"), href: "/developers/assistant", icon: lucide_react_1.Bot, description: t("projectDevDesc") },
|
|
47
|
+
{ label: t("projectSubmit"), href: "/developers/submit", icon: lucide_react_1.Send, description: t("projectSubmitDesc") },
|
|
48
|
+
{ label: t("projectStats"), href: "/developers/stats", icon: lucide_react_1.BarChart3, description: t("projectStatsDesc") },
|
|
49
|
+
];
|
|
50
|
+
const gameSubItems = [
|
|
51
|
+
{ label: "Crash Challenge", href: "/game/crash-challenge", icon: lucide_react_1.Crosshair, description: t("crashChallengeDesc") },
|
|
52
|
+
{ label: "Diamond Hands", href: "/game/diamond-hands", icon: lucide_react_1.Gem, description: t("hodlChallengeDesc") },
|
|
53
|
+
];
|
|
54
|
+
const navItems = [
|
|
55
|
+
{ label: "TITAN", href: "/titan", isTitan: true },
|
|
56
|
+
{ label: t("blockchain"), href: "/blockchain", submenuType: "blockchain" },
|
|
57
|
+
{ label: t("developers"), href: "/developers", submenuType: "developer" },
|
|
58
|
+
{ label: t("mainnetPlan"), href: "/mainnet" },
|
|
59
|
+
{ label: "GAME", href: "/game/crash-challenge", isGame: true, submenuType: "game" },
|
|
60
|
+
];
|
|
61
|
+
const handleLogout = async () => {
|
|
62
|
+
try {
|
|
63
|
+
await (0, auth_service_1.logOut)();
|
|
64
|
+
setShowUserMenu(false);
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
console.error(tc('logoutFailed'), error);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const displayName = userInfo?.display_name || userInfo?.email?.split('@')[0] || tc('defaultUser');
|
|
71
|
+
const handleUserMouseEnter = () => {
|
|
72
|
+
if (userMenuTimeoutRef.current)
|
|
73
|
+
clearTimeout(userMenuTimeoutRef.current);
|
|
74
|
+
setShowUserMenu(true);
|
|
75
|
+
};
|
|
76
|
+
const handleUserMouseLeave = () => {
|
|
77
|
+
userMenuTimeoutRef.current = setTimeout(() => setShowUserMenu(false), 150);
|
|
78
|
+
};
|
|
79
|
+
const handleDeveloperMouseEnter = () => {
|
|
80
|
+
if (developerMenuTimeoutRef.current)
|
|
81
|
+
clearTimeout(developerMenuTimeoutRef.current);
|
|
82
|
+
setShowDeveloperMenu(true);
|
|
83
|
+
};
|
|
84
|
+
const handleDeveloperMouseLeave = () => {
|
|
85
|
+
developerMenuTimeoutRef.current = setTimeout(() => setShowDeveloperMenu(false), 150);
|
|
86
|
+
};
|
|
87
|
+
const handleGameMouseEnter = () => {
|
|
88
|
+
if (gameMenuTimeoutRef.current)
|
|
89
|
+
clearTimeout(gameMenuTimeoutRef.current);
|
|
90
|
+
setShowGameMenu(true);
|
|
91
|
+
};
|
|
92
|
+
const handleGameMouseLeave = () => {
|
|
93
|
+
gameMenuTimeoutRef.current = setTimeout(() => setShowGameMenu(false), 150);
|
|
94
|
+
};
|
|
95
|
+
const handleBlockchainMouseEnter = () => {
|
|
96
|
+
if (blockchainMenuTimeoutRef.current)
|
|
97
|
+
clearTimeout(blockchainMenuTimeoutRef.current);
|
|
98
|
+
setShowBlockchainMenu(true);
|
|
99
|
+
};
|
|
100
|
+
const handleBlockchainMouseLeave = () => {
|
|
101
|
+
blockchainMenuTimeoutRef.current = setTimeout(() => setShowBlockchainMenu(false), 150);
|
|
102
|
+
};
|
|
103
|
+
(0, react_1.useEffect)(() => {
|
|
104
|
+
return () => {
|
|
105
|
+
if (blockchainMenuTimeoutRef.current)
|
|
106
|
+
clearTimeout(blockchainMenuTimeoutRef.current);
|
|
107
|
+
if (developerMenuTimeoutRef.current)
|
|
108
|
+
clearTimeout(developerMenuTimeoutRef.current);
|
|
109
|
+
if (userMenuTimeoutRef.current)
|
|
110
|
+
clearTimeout(userMenuTimeoutRef.current);
|
|
111
|
+
if (gameMenuTimeoutRef.current)
|
|
112
|
+
clearTimeout(gameMenuTimeoutRef.current);
|
|
113
|
+
};
|
|
114
|
+
}, []);
|
|
115
|
+
// Lock body scroll when mobile menu is open
|
|
116
|
+
(0, react_1.useEffect)(() => {
|
|
117
|
+
if (mobileMenuOpen) {
|
|
118
|
+
document.body.style.overflow = 'hidden';
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
document.body.style.overflow = '';
|
|
122
|
+
}
|
|
123
|
+
return () => { document.body.style.overflow = ''; };
|
|
124
|
+
}, [mobileMenuOpen]);
|
|
125
|
+
return ((0, jsx_runtime_1.jsxs)("nav", { className: "fixed top-0 left-0 right-0 z-50 bg-background/80 backdrop-blur-md border-b border-border/30", children: [(0, jsx_runtime_1.jsx)("div", { className: "max-w-7xl mx-auto px-3 2xs:px-4 md:px-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between h-14 2xs:h-16", children: [(0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: "/", className: "flex items-center gap-2 xs:gap-3 shrink-0", children: [(0, jsx_runtime_1.jsx)("img", { src: "/mcc-logo-40.png", alt: "MCC", className: "w-8 h-8 xs:w-9 xs:h-9 sm:w-10 sm:h-10 rounded" }), (0, jsx_runtime_1.jsxs)("span", { className: "font-sans font-semibold text-lg xs:text-xl sm:text-2xl tracking-wide text-foreground", children: ["M", (0, jsx_runtime_1.jsx)("span", { className: "text-green-400", children: "I" }), "CROCOSM"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "hidden lg:flex items-center gap-1 xl:gap-2", children: navItems.map((item) => {
|
|
126
|
+
// Blockchain submenu (includes Market + Community)
|
|
127
|
+
if (item.submenuType === "blockchain") {
|
|
128
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "relative", onMouseEnter: handleBlockchainMouseEnter, onMouseLeave: handleBlockchainMouseLeave, children: [(0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: item.href, className: "px-2.5 xl:px-4 py-2 text-sm xl:text-base text-foreground/70 hover:text-foreground hover:bg-foreground/5 rounded transition-colors duration-200 flex items-center gap-1 text-truncate-safe", children: [item.label, (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: (0, utils_1.cn)("h-4 w-4 transition-transform duration-200 shrink-0", showBlockchainMenu && "rotate-180") })] }), showBlockchainMenu && ((0, jsx_runtime_1.jsxs)("div", { className: "absolute top-full left-0 mt-2 w-64 rounded-xl border border-border/50 bg-card/95 backdrop-blur-xl shadow-xl overflow-hidden z-50", children: [(0, jsx_runtime_1.jsx)("div", { className: "p-2", children: blockchainSubItems.map((subItem, subIdx) => ((0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: subItem.href, className: "flex items-start gap-3 px-3 py-2.5 rounded-lg hover:bg-secondary/50 transition-colors group", onClick: () => setShowBlockchainMenu(false), children: [(0, jsx_runtime_1.jsx)(subItem.icon, { className: "h-5 w-5 text-muted-foreground group-hover:text-green-400 transition-colors mt-0.5" }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-sm font-medium text-foreground group-hover:text-green-400 transition-colors", children: subItem.label }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-muted-foreground break-safe", children: subItem.description })] })] }, subIdx))) }), (0, jsx_runtime_1.jsx)("div", { className: "border-t border-border/50 px-4 py-3 bg-secondary/30", children: (0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: "/blockchain", className: "text-xs text-muted-foreground hover:text-green-400 transition-colors", onClick: () => setShowBlockchainMenu(false), children: [t("blockchain"), " \u2192"] }) })] }))] }, item.label));
|
|
129
|
+
}
|
|
130
|
+
// Developer submenu
|
|
131
|
+
if (item.submenuType === "developer") {
|
|
132
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "relative", onMouseEnter: handleDeveloperMouseEnter, onMouseLeave: handleDeveloperMouseLeave, children: [(0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: item.href, className: "px-2.5 xl:px-4 py-2 text-sm xl:text-base text-foreground/70 hover:text-foreground hover:bg-foreground/5 rounded transition-colors duration-200 flex items-center gap-1 text-truncate-safe", children: [item.label, (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: (0, utils_1.cn)("h-4 w-4 transition-transform duration-200 shrink-0", showDeveloperMenu && "rotate-180") })] }), showDeveloperMenu && ((0, jsx_runtime_1.jsxs)("div", { className: "absolute top-full left-0 mt-2 w-64 rounded-xl border border-border/50 bg-card/95 backdrop-blur-xl shadow-xl overflow-hidden z-50", children: [(0, jsx_runtime_1.jsx)("div", { className: "p-2", children: developerSubItems.map((subItem, subIdx) => ((0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: subItem.href, className: "flex items-start gap-3 px-3 py-2.5 rounded-lg hover:bg-secondary/50 transition-colors group", onClick: () => setShowDeveloperMenu(false), children: [(0, jsx_runtime_1.jsx)(subItem.icon, { className: "h-5 w-5 text-muted-foreground group-hover:text-green-400 transition-colors mt-0.5" }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-sm font-medium text-foreground group-hover:text-green-400 transition-colors", children: subItem.label }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-muted-foreground break-safe", children: subItem.description })] })] }, subIdx))) }), (0, jsx_runtime_1.jsx)("div", { className: "border-t border-border/50 px-4 py-3 bg-secondary/30", children: (0, jsx_runtime_1.jsx)(navigation_1.Link, { href: "/developers", className: "text-xs text-muted-foreground hover:text-green-400 transition-colors", onClick: () => setShowDeveloperMenu(false), children: tc('viewDeveloperCenter') }) })] }))] }, item.label));
|
|
133
|
+
}
|
|
134
|
+
if (item.submenuType === "game") {
|
|
135
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "relative", onMouseEnter: handleGameMouseEnter, onMouseLeave: handleGameMouseLeave, children: [(0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: item.href, className: "px-2.5 xl:px-4 py-2 text-sm xl:text-base text-foreground/70 hover:text-foreground hover:bg-foreground/5 rounded transition-colors duration-200 flex items-center gap-1 text-truncate-safe", children: [(0, jsx_runtime_1.jsx)(GameLabel, {}), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: (0, utils_1.cn)("h-4 w-4 transition-transform duration-200 shrink-0", showGameMenu && "rotate-180") })] }), showGameMenu && ((0, jsx_runtime_1.jsxs)("div", { className: "absolute top-full right-0 mt-2 w-64 rounded-xl border border-border/50 bg-card/95 backdrop-blur-xl shadow-xl overflow-hidden z-50", children: [(0, jsx_runtime_1.jsx)("div", { className: "p-2", children: gameSubItems.map((subItem, subIdx) => ((0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: subItem.href, className: "flex items-start gap-3 px-3 py-2.5 rounded-lg hover:bg-secondary/50 transition-colors group", onClick: () => setShowGameMenu(false), children: [(0, jsx_runtime_1.jsx)(subItem.icon, { className: "h-5 w-5 text-muted-foreground group-hover:text-green-400 transition-colors mt-0.5" }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-sm font-medium text-foreground group-hover:text-green-400 transition-colors", children: subItem.label }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-muted-foreground break-safe", children: subItem.description })] })] }, subIdx))) }), (0, jsx_runtime_1.jsx)("div", { className: "border-t border-border/50 px-4 py-3 bg-secondary/30", children: (0, jsx_runtime_1.jsx)(navigation_1.Link, { href: "/game/crash-challenge", className: "text-xs text-muted-foreground hover:text-green-400 transition-colors", onClick: () => setShowGameMenu(false), children: "GAME \u2192" }) })] }))] }, item.label));
|
|
136
|
+
}
|
|
137
|
+
return ((0, jsx_runtime_1.jsx)(navigation_1.Link, { href: item.href, className: "px-2.5 xl:px-4 py-2 text-sm xl:text-base text-foreground/70 hover:text-foreground hover:bg-foreground/5 rounded transition-colors duration-200 text-truncate-safe", children: "isTitan" in item && item.isTitan ? (0, jsx_runtime_1.jsx)(TitanLabel, {}) : item.label }, item.label));
|
|
138
|
+
}) }), (0, jsx_runtime_1.jsxs)("div", { className: "hidden lg:flex items-center gap-2 xl:gap-3", children: [(0, jsx_runtime_1.jsx)(LocaleSwitcher_1.LocaleSwitcher, {}), loading ? ((0, jsx_runtime_1.jsx)("span", { className: "px-4 py-2 text-foreground/50", children: tc('loading') })) : user ? ((0, jsx_runtime_1.jsxs)("div", { className: "relative", onMouseEnter: handleUserMouseEnter, onMouseLeave: handleUserMouseLeave, children: [(0, jsx_runtime_1.jsxs)("button", { className: "flex items-center gap-2 px-3 py-1.5 rounded-full bg-foreground/5 hover:bg-foreground/10 transition-colors", children: [(0, jsx_runtime_1.jsx)(hover_avatar_1.HoverAvatar, { src: userInfo?.avatar_url, fallback: displayName, size: 32, fallbackClassName: "bg-green-500/20 text-green-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm font-medium text-foreground max-w-[100px] truncate", children: displayName }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { size: 14, className: (0, utils_1.cn)("text-foreground/50 transition-transform duration-200", showUserMenu && "rotate-180") })] }), showUserMenu && ((0, jsx_runtime_1.jsx)("div", { className: "absolute top-full right-0 mt-2 w-48 rounded-xl border border-border/50 bg-card/95 backdrop-blur-xl shadow-xl overflow-hidden z-50", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-2", children: [(0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: "/user-system/dashboard", className: "flex items-center gap-2 px-3 py-2.5 rounded-lg text-sm text-foreground/70 hover:text-foreground hover:bg-secondary/50 transition-colors", onClick: () => setShowUserMenu(false), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.LayoutDashboard, { size: 16 }), tc('dashboard')] }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleLogout, className: "w-full flex items-center gap-2 px-3 py-2.5 rounded-lg text-sm text-foreground/70 hover:text-red-400 hover:bg-secondary/50 transition-colors", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.LogOut, { size: 16 }), tc('logout')] })] }) }))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(navigation_1.Link, { href: "/login", className: "px-4 py-2 text-foreground/70 hover:text-foreground transition-colors duration-200", children: tc('login') }), (0, jsx_runtime_1.jsx)(navigation_1.Link, { href: "/register", className: "px-5 py-2 bg-accent text-accent-foreground hover:bg-accent/90 rounded transition-colors duration-200", children: tc('register') })] }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "lg:hidden flex items-center gap-1 2xs:gap-2", children: [(0, jsx_runtime_1.jsx)(LocaleSwitcher_1.LocaleSwitcher, {}), (0, jsx_runtime_1.jsx)("button", { className: "p-1.5 2xs:p-2 text-foreground/70 hover:text-foreground touch-target", onClick: () => setMobileMenuOpen(!mobileMenuOpen), children: mobileMenuOpen ? (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "w-5 h-5 2xs:w-6 2xs:h-6" }) : (0, jsx_runtime_1.jsx)(lucide_react_1.Menu, { className: "w-5 h-5 2xs:w-6 2xs:h-6" }) })] })] }) }), (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("lg:hidden overflow-y-auto transition-all duration-300 bg-background/95 backdrop-blur-md border-b border-border/30", mobileMenuOpen ? "max-h-[calc(100vh-56px)] 2xs:max-h-[calc(100vh-64px)]" : "max-h-0"), children: (0, jsx_runtime_1.jsxs)("div", { className: "px-3 2xs:px-4 py-3 2xs:py-4 space-y-1 2xs:space-y-2", children: [navItems.map((item) => {
|
|
139
|
+
// Mobile blockchain submenu
|
|
140
|
+
if (item.submenuType === "blockchain") {
|
|
141
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => setMobileBlockchainExpanded(!mobileBlockchainExpanded), className: "w-full flex items-center justify-between px-3 2xs:px-4 py-2.5 2xs:py-3 font-mono text-xs 2xs:text-sm text-foreground/70 hover:text-foreground hover:bg-foreground/5 rounded transition-colors duration-200 touch-target", children: [(0, jsx_runtime_1.jsx)("span", { children: item.label }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: (0, utils_1.cn)("h-4 w-4 transition-transform duration-200", mobileBlockchainExpanded && "rotate-180") })] }), (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("overflow-hidden transition-all duration-300", mobileBlockchainExpanded ? "max-h-96 opacity-100" : "max-h-0 opacity-0"), children: (0, jsx_runtime_1.jsxs)("div", { className: "ml-3 2xs:ml-4 border-l border-border/30 pl-1.5 2xs:pl-2 space-y-0.5 2xs:space-y-1 py-1.5 2xs:py-2", children: [(0, jsx_runtime_1.jsx)(navigation_1.Link, { href: item.href, className: "flex items-center gap-2 px-2 2xs:px-3 py-1.5 2xs:py-2 text-xs text-green-400 hover:text-green-300 hover:bg-foreground/5 rounded transition-colors duration-200 touch-target", onClick: () => setMobileMenuOpen(false), children: t("blockchain") }), blockchainSubItems.map((subItem, subIdx) => ((0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: subItem.href, className: "flex items-center gap-2 px-2 2xs:px-3 py-1.5 2xs:py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-foreground/5 rounded transition-colors duration-200 touch-target", onClick: () => setMobileMenuOpen(false), children: [(0, jsx_runtime_1.jsx)(subItem.icon, { className: "h-3.5 w-3.5 2xs:h-4 2xs:w-4 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-truncate-safe", children: subItem.label })] }, subIdx)))] }) })] }, item.label));
|
|
142
|
+
}
|
|
143
|
+
// Mobile developer submenu
|
|
144
|
+
if (item.submenuType === "developer") {
|
|
145
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => setMobileDevExpanded(!mobileDevExpanded), className: "w-full flex items-center justify-between px-3 2xs:px-4 py-2.5 2xs:py-3 font-mono text-xs 2xs:text-sm text-foreground/70 hover:text-foreground hover:bg-foreground/5 rounded transition-colors duration-200 touch-target", children: [(0, jsx_runtime_1.jsx)("span", { children: item.label }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: (0, utils_1.cn)("h-4 w-4 transition-transform duration-200", mobileDevExpanded && "rotate-180") })] }), (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("overflow-hidden transition-all duration-300", mobileDevExpanded ? "max-h-96 opacity-100" : "max-h-0 opacity-0"), children: (0, jsx_runtime_1.jsxs)("div", { className: "ml-3 2xs:ml-4 border-l border-border/30 pl-1.5 2xs:pl-2 space-y-0.5 2xs:space-y-1 py-1.5 2xs:py-2", children: [(0, jsx_runtime_1.jsx)(navigation_1.Link, { href: item.href, className: "flex items-center gap-2 px-2 2xs:px-3 py-1.5 2xs:py-2 text-xs text-green-400 hover:text-green-300 hover:bg-foreground/5 rounded transition-colors duration-200 touch-target", onClick: () => setMobileMenuOpen(false), children: tc('developerCenterHome') }), developerSubItems.map((subItem, subIdx) => ((0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: subItem.href, className: "flex items-center gap-2 px-2 2xs:px-3 py-1.5 2xs:py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-foreground/5 rounded transition-colors duration-200 touch-target", onClick: () => setMobileMenuOpen(false), children: [(0, jsx_runtime_1.jsx)(subItem.icon, { className: "h-3.5 w-3.5 2xs:h-4 2xs:w-4 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-truncate-safe", children: subItem.label })] }, subIdx)))] }) })] }, item.label));
|
|
146
|
+
}
|
|
147
|
+
if (item.submenuType === "game") {
|
|
148
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => setMobileGameExpanded(!mobileGameExpanded), className: "w-full flex items-center justify-between px-3 2xs:px-4 py-2.5 2xs:py-3 font-mono text-xs 2xs:text-sm text-foreground/70 hover:text-foreground hover:bg-foreground/5 rounded transition-colors duration-200 touch-target", children: [(0, jsx_runtime_1.jsx)(GameLabel, {}), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: (0, utils_1.cn)("h-4 w-4 transition-transform duration-200", mobileGameExpanded && "rotate-180") })] }), (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("overflow-hidden transition-all duration-300", mobileGameExpanded ? "max-h-96 opacity-100" : "max-h-0 opacity-0"), children: (0, jsx_runtime_1.jsx)("div", { className: "ml-3 2xs:ml-4 border-l border-border/30 pl-1.5 2xs:pl-2 space-y-0.5 2xs:space-y-1 py-1.5 2xs:py-2", children: gameSubItems.map((subItem, subIdx) => ((0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: subItem.href, className: "flex items-center gap-2 px-2 2xs:px-3 py-1.5 2xs:py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-foreground/5 rounded transition-colors duration-200 touch-target", onClick: () => setMobileMenuOpen(false), children: [(0, jsx_runtime_1.jsx)(subItem.icon, { className: "h-3.5 w-3.5 2xs:h-4 2xs:w-4 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-truncate-safe", children: subItem.label })] }, subIdx))) }) })] }, item.label));
|
|
149
|
+
}
|
|
150
|
+
return ((0, jsx_runtime_1.jsx)(navigation_1.Link, { href: item.href, className: "block px-3 2xs:px-4 py-2.5 2xs:py-3 font-mono text-xs 2xs:text-sm text-foreground/70 hover:text-foreground hover:bg-foreground/5 rounded transition-colors duration-200 touch-target", onClick: () => setMobileMenuOpen(false), children: "isTitan" in item && item.isTitan ? (0, jsx_runtime_1.jsx)(TitanLabel, {}) : item.label }, item.label));
|
|
151
|
+
}), (0, jsx_runtime_1.jsx)("div", { className: "pt-3 2xs:pt-4 border-t border-border/30", children: user ? ((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-2 2xs:gap-3 px-3 2xs:px-4 py-2.5 2xs:py-3 bg-foreground/5 rounded-lg", children: [(0, jsx_runtime_1.jsx)(hover_avatar_1.HoverAvatar, { src: userInfo?.avatar_url, fallback: displayName, size: 32, fallbackClassName: "bg-green-500/20 text-green-400" }), (0, jsx_runtime_1.jsxs)("div", { className: "min-w-0 flex-1", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-sm 2xs:text-base font-medium text-foreground truncate", children: displayName }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs text-muted-foreground truncate", children: userInfo?.email })] })] }), (0, jsx_runtime_1.jsx)(navigation_1.Link, { href: "/user-system/dashboard", onClick: () => setMobileMenuOpen(false), className: "block w-full px-3 2xs:px-4 py-2.5 2xs:py-3 font-mono text-xs 2xs:text-sm text-center bg-accent text-accent-foreground hover:bg-accent/90 rounded transition-colors duration-200 touch-target", children: tc('enterDashboard') }), (0, jsx_runtime_1.jsx)("button", { onClick: () => {
|
|
152
|
+
handleLogout();
|
|
153
|
+
setMobileMenuOpen(false);
|
|
154
|
+
}, className: "w-full px-3 2xs:px-4 py-2.5 2xs:py-3 font-mono text-xs 2xs:text-sm text-center text-foreground/70 hover:text-red-400 border border-border/50 hover:border-red-500/50 rounded transition-colors duration-200 touch-target", children: tc('logout') })] })) : ((0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2 2xs:gap-3", children: [(0, jsx_runtime_1.jsx)(navigation_1.Link, { href: "/login", className: "flex-1 px-3 2xs:px-4 py-2.5 2xs:py-3 font-mono text-xs 2xs:text-sm text-center text-foreground/70 hover:text-foreground border border-border/50 rounded transition-colors duration-200 touch-target", children: tc('login') }), (0, jsx_runtime_1.jsx)(navigation_1.Link, { href: "/register", className: "flex-1 px-3 2xs:px-4 py-2.5 2xs:py-3 font-mono text-xs 2xs:text-sm text-center bg-accent text-accent-foreground hover:bg-accent/90 rounded transition-colors duration-200 touch-target", children: tc('register') })] })) })] }) })] }));
|
|
155
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function TerminalSidebar(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
"use client";
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
+
}) : function(o, v) {
|
|
18
|
+
o["default"] = v;
|
|
19
|
+
});
|
|
20
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
21
|
+
var ownKeys = function(o) {
|
|
22
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
23
|
+
var ar = [];
|
|
24
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
25
|
+
return ar;
|
|
26
|
+
};
|
|
27
|
+
return ownKeys(o);
|
|
28
|
+
};
|
|
29
|
+
return function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.TerminalSidebar = TerminalSidebar;
|
|
39
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
40
|
+
const React = __importStar(require("react"));
|
|
41
|
+
const navigation_1 = require("../../i18n/navigation");
|
|
42
|
+
const navigation_2 = require("next/navigation");
|
|
43
|
+
const lucide_react_1 = require("lucide-react");
|
|
44
|
+
const utils_1 = require("../../lib/utils");
|
|
45
|
+
const useAuth_1 = require("../../hooks/useAuth");
|
|
46
|
+
const auth_service_1 = require("../../lib/auth-service");
|
|
47
|
+
const menu_config_1 = require("../../config/menu-config");
|
|
48
|
+
const hover_avatar_1 = require("../ui/hover-avatar");
|
|
49
|
+
const next_intl_1 = require("next-intl");
|
|
50
|
+
function TerminalMenuItem({ item, collapsed, onNavigate, }) {
|
|
51
|
+
const pathname = (0, navigation_2.usePathname)();
|
|
52
|
+
const isActive = (0, menu_config_1.isMenuItemActive)(item.href, pathname);
|
|
53
|
+
const [isOpen, setIsOpen] = React.useState(isActive);
|
|
54
|
+
const tm = (0, next_intl_1.useTranslations)("menu");
|
|
55
|
+
React.useEffect(() => {
|
|
56
|
+
if (isActive)
|
|
57
|
+
setIsOpen(true);
|
|
58
|
+
}, [isActive]);
|
|
59
|
+
if (item.isSection) {
|
|
60
|
+
if (collapsed)
|
|
61
|
+
return null;
|
|
62
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "px-2 xs:px-3 py-1.5 xs:py-2 text-[10px] xs:text-xs text-neutral-500 uppercase tracking-wider font-medium", children: tm(item.titleKey) }));
|
|
63
|
+
}
|
|
64
|
+
if (item.children && item.children.length > 0) {
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => setIsOpen(!isOpen), className: (0, utils_1.cn)("w-full flex items-center gap-2 xs:gap-3 px-2 xs:px-3 py-2 xs:py-2.5 text-xs xs:text-sm rounded transition-colors touch-target", isActive
|
|
66
|
+
? "bg-cyan-700 text-white"
|
|
67
|
+
: "text-neutral-400 hover:text-white hover:bg-neutral-800"), children: [(0, jsx_runtime_1.jsx)(item.icon, { className: "w-4 h-4 xs:w-5 xs:h-5 flex-shrink-0" }), !collapsed && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: "flex-1 text-left font-medium text-truncate-safe", children: tm(item.titleKey) }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: (0, utils_1.cn)("w-3.5 h-3.5 xs:w-4 xs:h-4 transition-transform", isOpen && "rotate-90") })] }))] }), isOpen && !collapsed && ((0, jsx_runtime_1.jsx)("div", { className: "ml-3 xs:ml-4 border-l border-neutral-700 pl-1.5 xs:pl-2 mt-1 space-y-0.5", children: item.children.map((child) => {
|
|
68
|
+
const childActive = (0, menu_config_1.isMenuItemActive)(child.href, pathname);
|
|
69
|
+
return ((0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: child.href, onClick: onNavigate, className: (0, utils_1.cn)("flex items-center gap-1.5 xs:gap-2 px-2 xs:px-3 py-1.5 text-xs xs:text-sm rounded transition-colors", childActive
|
|
70
|
+
? "bg-cyan-700 text-white"
|
|
71
|
+
: "text-neutral-500 hover:text-white hover:bg-neutral-800"), children: [(0, jsx_runtime_1.jsx)(child.icon, { className: "w-3 h-3 xs:w-3.5 xs:h-3.5" }), (0, jsx_runtime_1.jsx)("span", { className: "text-truncate-safe", children: tm(child.titleKey) })] }, child.href));
|
|
72
|
+
}) }))] }));
|
|
73
|
+
}
|
|
74
|
+
return ((0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: item.href, onClick: onNavigate, className: (0, utils_1.cn)("flex items-center gap-2 xs:gap-3 px-2 xs:px-3 py-2 xs:py-2.5 text-xs xs:text-sm rounded transition-colors touch-target", isActive
|
|
75
|
+
? "bg-cyan-700 text-white"
|
|
76
|
+
: "text-neutral-400 hover:text-white hover:bg-neutral-800"), title: collapsed ? tm(item.titleKey) : undefined, children: [(0, jsx_runtime_1.jsx)(item.icon, { className: "w-4 h-4 xs:w-5 xs:h-5 flex-shrink-0" }), !collapsed && (0, jsx_runtime_1.jsx)("span", { className: "font-medium text-truncate-safe", children: tm(item.titleKey) }), !collapsed && item.badge && ((0, jsx_runtime_1.jsx)("span", { className: "ml-auto px-1 xs:px-1.5 py-0.5 text-[10px] xs:text-xs bg-cyan-400/20 text-cyan-400 rounded", children: item.badge }))] }));
|
|
77
|
+
}
|
|
78
|
+
function TerminalSidebar() {
|
|
79
|
+
const { user, userInfo } = (0, useAuth_1.useAuth)();
|
|
80
|
+
const userRole = userInfo?.role || "user";
|
|
81
|
+
const menus = React.useMemo(() => (0, menu_config_1.getUserMenus)(userRole), [userRole]);
|
|
82
|
+
const [collapsed, setCollapsed] = React.useState(false);
|
|
83
|
+
const [mobileOpen, setMobileOpen] = React.useState(false);
|
|
84
|
+
const tc = (0, next_intl_1.useTranslations)("common");
|
|
85
|
+
const displayName = userInfo?.display_name || userInfo?.email?.split('@')[0] || tc('defaultUser');
|
|
86
|
+
React.useEffect(() => {
|
|
87
|
+
if (mobileOpen) {
|
|
88
|
+
document.body.style.overflow = 'hidden';
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
document.body.style.overflow = '';
|
|
92
|
+
}
|
|
93
|
+
return () => { document.body.style.overflow = ''; };
|
|
94
|
+
}, [mobileOpen]);
|
|
95
|
+
// Close mobile sidebar on navigation
|
|
96
|
+
const handleMobileNavigate = React.useCallback(() => {
|
|
97
|
+
setMobileOpen(false);
|
|
98
|
+
}, []);
|
|
99
|
+
const handleLogout = () => {
|
|
100
|
+
(0, auth_service_1.logOut)();
|
|
101
|
+
};
|
|
102
|
+
const sidebarContent = ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col h-full md:bg-neutral-900 border-r border-neutral-700/50 md:border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "hidden xs:flex items-center justify-end px-2 xs:px-3 py-1", children: (0, jsx_runtime_1.jsx)("button", { onClick: () => setCollapsed(!collapsed), className: "p-1 rounded text-neutral-400 hover:text-cyan-400 transition-colors", title: collapsed ? tc('expandSidebar') : tc('collapseSidebar'), children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: (0, utils_1.cn)("w-4 h-4 transition-transform", !collapsed && "rotate-180") }) }) }), (0, jsx_runtime_1.jsxs)("nav", { className: "flex-1 overflow-y-auto px-2 xs:px-3 space-y-0.5 xs:space-y-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "space-y-0.5 xs:space-y-1 mb-4 xs:mb-6", children: menus.userMenu.map((item) => ((0, jsx_runtime_1.jsx)(TerminalMenuItem, { item: item, collapsed: collapsed, onNavigate: handleMobileNavigate }, item.href))) }), menus.agentMenu && menus.agentMenu.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-0.5 xs:space-y-1 mb-4 xs:mb-6", children: [!collapsed && ((0, jsx_runtime_1.jsx)("div", { className: "px-2 xs:px-3 py-1.5 xs:py-2 text-[10px] xs:text-xs text-neutral-500 uppercase tracking-wider font-medium", children: "AGENT" })), menus.agentMenu.map((item) => ((0, jsx_runtime_1.jsx)(TerminalMenuItem, { item: item, collapsed: collapsed, onNavigate: handleMobileNavigate }, item.href)))] }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-4 xs:mt-6 pt-3 xs:pt-4 border-t border-neutral-800 px-2 xs:px-3 pb-2 xs:pb-3 safe-area-bottom", children: [!collapsed && ((0, jsx_runtime_1.jsx)(navigation_1.Link, { href: "/profile", onClick: handleMobileNavigate, className: "mb-3 xs:mb-4 p-2 xs:p-3 bg-neutral-800 border border-neutral-700 rounded-lg block hover:border-neutral-600 hover:bg-neutral-800/80 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 xs:gap-3", children: [(0, jsx_runtime_1.jsx)(hover_avatar_1.HoverAvatar, { src: userInfo?.avatar_url, fallback: displayName, size: 36, fallbackClassName: "bg-neutral-700 text-neutral-400" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 min-w-0", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-xs xs:text-sm font-medium text-white truncate", children: displayName }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 xs:gap-1.5", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-1.5 h-1.5 bg-green-400 rounded-full animate-pulse" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[9px] xs:text-[10px] text-neutral-500 uppercase tracking-wider", children: userRole === 'admin' ? 'ADMIN' : 'USER' })] })] })] }) })), collapsed && ((0, jsx_runtime_1.jsx)(navigation_1.Link, { href: "/profile", className: "flex justify-center mb-3", children: (0, jsx_runtime_1.jsx)(hover_avatar_1.HoverAvatar, { src: userInfo?.avatar_url, fallback: displayName, size: 32, fallbackClassName: "bg-neutral-700 text-neutral-400" }) })), (0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: "/profile", onClick: handleMobileNavigate, className: "w-full flex items-center gap-2 xs:gap-3 px-2 xs:px-3 py-2 xs:py-2.5 rounded transition-colors text-neutral-400 hover:text-cyan-400 hover:bg-cyan-400/10 touch-target", title: collapsed ? tc('accountManagement') : undefined, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Link2, { className: "w-4 h-4 xs:w-5 xs:h-5 shrink-0" }), !collapsed && (0, jsx_runtime_1.jsx)("span", { className: "text-xs xs:text-sm font-medium text-truncate-safe", children: tc('accountManagement') })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleLogout, className: (0, utils_1.cn)("w-full mt-1 flex items-center gap-2 xs:gap-3 px-2 xs:px-3 py-2 xs:py-2.5 rounded text-neutral-500 hover:text-red-400 hover:bg-neutral-800 transition-colors touch-target", collapsed ? "justify-center" : ""), title: collapsed ? tc('logout') : undefined, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.LogOut, { className: "w-4 h-4 xs:w-5 xs:h-5 shrink-0" }), !collapsed && (0, jsx_runtime_1.jsx)("span", { className: "text-xs xs:text-sm", children: tc('logout') })] })] })] }));
|
|
103
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => setMobileOpen(!mobileOpen), className: "md:hidden fixed top-3 2xs:top-3.5 left-2 2xs:left-3 xs:left-4 z-[60] p-1.5 2xs:p-2 bg-neutral-800/60 backdrop-blur-md border border-neutral-700/50 rounded text-neutral-400 hover:text-white touch-target", children: mobileOpen ? (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "w-4 h-4 2xs:w-5 2xs:h-5" }) : (0, jsx_runtime_1.jsx)(lucide_react_1.Menu, { className: "w-4 h-4 2xs:w-5 2xs:h-5" }) }), mobileOpen && ((0, jsx_runtime_1.jsx)("div", { className: "md:hidden fixed inset-0 top-14 2xs:top-16 bg-black/60 z-40 overscroll-contain touch-none", onClick: () => setMobileOpen(false) })), (0, jsx_runtime_1.jsx)("aside", { className: (0, utils_1.cn)("fixed md:relative md:flex-shrink-0 top-14 2xs:top-16 md:top-0 z-[45] md:z-40 sidebar-frost", "h-[calc(100vh-56px)] 2xs:h-[calc(100vh-64px)] md:h-full", "transition-[left,width] duration-300 md:transition-all",
|
|
104
|
+
// Width: full on tiny, 80% on small phone, w-64 on tablet+
|
|
105
|
+
mobileOpen
|
|
106
|
+
? "left-0 w-[85%] 2xs:w-[80%] xs:w-72 sm:w-72"
|
|
107
|
+
: "-left-[100%] xs:-left-72 md:left-0",
|
|
108
|
+
// Desktop: collapsible
|
|
109
|
+
!mobileOpen && (collapsed ? "md:w-16" : "md:w-64")), children: sidebarContent })] }));
|
|
110
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function LendingPage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
'use client';
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.default = LendingPage;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const lucide_react_1 = require("lucide-react");
|
|
8
|
+
const card_1 = require("../ui/card");
|
|
9
|
+
const next_intl_1 = require("next-intl");
|
|
10
|
+
function LendingPage() {
|
|
11
|
+
const t = (0, next_intl_1.useTranslations)('lendingDash');
|
|
12
|
+
const COLLATERAL_TYPES = {
|
|
13
|
+
Station: { value: 1000, label: 'Station', description: t('stationDesc') },
|
|
14
|
+
Matrix: { value: 15000, label: 'Matrix', description: t('matrixDesc') },
|
|
15
|
+
Sector: { value: 200000, label: 'Sector', description: t('sectorDesc') },
|
|
16
|
+
System: { value: 2500000, label: 'System', description: t('systemDesc') },
|
|
17
|
+
};
|
|
18
|
+
const formatNumber = (num, decimals = 2) => num.toLocaleString('en-US', { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
19
|
+
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", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-lg sm:text-2xl font-bold text-white tracking-wider", children: t('title') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400", children: t('subtitle') })] }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('myDeposits') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center py-8 text-neutral-500", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "w-12 h-12 mx-auto mb-2 opacity-50" }), (0, jsx_runtime_1.jsx)("p", { children: t('noDeposits') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm mt-1", children: t('noDepositsHint') })] })] }) }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CreditCard, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('myLoans') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center py-8 text-neutral-500", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CreditCard, { className: "w-12 h-12 mx-auto mb-2 opacity-50" }), (0, jsx_runtime_1.jsx)("p", { children: t('noLoans') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm mt-1", children: t('noLoansHint') })] })] }) }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Info, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('protocolInfo') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-4 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded", children: [(0, jsx_runtime_1.jsx)("div", { className: "font-medium text-white mb-2", children: t('loanRules') }), (0, jsx_runtime_1.jsxs)("ul", { className: "list-disc list-inside space-y-1 text-neutral-400", children: [(0, jsx_runtime_1.jsx)("li", { children: t('loanRule1') }), (0, jsx_runtime_1.jsx)("li", { children: t('loanRule2') }), (0, jsx_runtime_1.jsx)("li", { children: t('loanRule3') }), (0, jsx_runtime_1.jsx)("li", { children: t('loanRule4') })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded", children: [(0, jsx_runtime_1.jsx)("div", { className: "font-medium text-white mb-2", children: t('liquidationRules') }), (0, jsx_runtime_1.jsxs)("ul", { className: "list-disc list-inside space-y-1 text-neutral-400", children: [(0, jsx_runtime_1.jsx)("li", { children: t('liquidationRule1') }), (0, jsx_runtime_1.jsx)("li", { children: t('liquidationRule2') }), (0, jsx_runtime_1.jsx)("li", { children: t('liquidationRule3') })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded", children: [(0, jsx_runtime_1.jsx)("div", { className: "font-medium text-white mb-2", children: t('nftValuation') }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4 mt-2", children: Object.entries(COLLATERAL_TYPES).map(([key, value]) => ((0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-neutral-400 text-xs", children: value.description }), (0, jsx_runtime_1.jsx)("div", { className: "text-white font-bold font-mono", children: formatNumber(value.value) }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs", children: "MCC" })] }, key))) })] })] })] }) })] }));
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function MCDPage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
'use client';
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.default = MCDPage;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const useAuth_1 = require("../../hooks/useAuth");
|
|
9
|
+
const useMCD_1 = require("../../hooks/useMCD");
|
|
10
|
+
const api_1 = require("../../lib/api");
|
|
11
|
+
const blockchain_1 = require("../../lib/api/blockchain");
|
|
12
|
+
const card_1 = require("../ui/card");
|
|
13
|
+
const badge_1 = require("../ui/badge");
|
|
14
|
+
const button_1 = require("../ui/button");
|
|
15
|
+
const tabs_1 = require("../ui/tabs");
|
|
16
|
+
const skeleton_1 = require("../ui/skeleton");
|
|
17
|
+
const table_1 = require("../ui/table");
|
|
18
|
+
const dialog_1 = require("../ui/dialog");
|
|
19
|
+
const lucide_react_1 = require("lucide-react");
|
|
20
|
+
const navigation_1 = require("../../i18n/navigation");
|
|
21
|
+
const next_intl_1 = require("next-intl");
|
|
22
|
+
const TX_TYPE_COLORS = {
|
|
23
|
+
daily_distribution: 'bg-white/20 text-white border-transparent',
|
|
24
|
+
spend: 'bg-red-500/20 text-red-500 border-transparent',
|
|
25
|
+
transfer: 'bg-cyan-400/20 text-cyan-400 border-transparent',
|
|
26
|
+
refund: 'bg-cyan-400/20 text-cyan-400 border-transparent'
|
|
27
|
+
};
|
|
28
|
+
// TX_TYPE_NAMES moved to component scope for i18n
|
|
29
|
+
function formatDate(dateStr) {
|
|
30
|
+
const date = new Date(dateStr);
|
|
31
|
+
return date.toLocaleDateString('zh-CN', {
|
|
32
|
+
year: 'numeric',
|
|
33
|
+
month: '2-digit',
|
|
34
|
+
day: '2-digit',
|
|
35
|
+
hour: '2-digit',
|
|
36
|
+
minute: '2-digit'
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function formatShortDate(dateStr) {
|
|
40
|
+
const date = new Date(dateStr);
|
|
41
|
+
return date.toLocaleDateString('zh-CN', {
|
|
42
|
+
month: '2-digit',
|
|
43
|
+
day: '2-digit'
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function MCDPage() {
|
|
47
|
+
const t = (0, next_intl_1.useTranslations)('mcdDash');
|
|
48
|
+
const { user } = (0, useAuth_1.useAuth)();
|
|
49
|
+
const TX_TYPE_NAMES = {
|
|
50
|
+
daily_distribution: t('txTypeDaily'),
|
|
51
|
+
spend: t('txTypeSpend'),
|
|
52
|
+
transfer: t('txTypeTransfer'),
|
|
53
|
+
refund: t('txTypeRefund')
|
|
54
|
+
};
|
|
55
|
+
const { transactions, dailyRewards, loading: dbLoading, isRefreshing, error, refresh } = (0, useMCD_1.useMCD)(user?.uid);
|
|
56
|
+
const [showHelp, setShowHelp] = (0, react_1.useState)(false);
|
|
57
|
+
const [walletMCDs, setWalletMCDs] = (0, react_1.useState)([]);
|
|
58
|
+
const [walletsLoading, setWalletsLoading] = (0, react_1.useState)(true);
|
|
59
|
+
const [walletsExpanded, setWalletsExpanded] = (0, react_1.useState)(false);
|
|
60
|
+
const loadOnChainMCD = (0, react_1.useCallback)(async () => {
|
|
61
|
+
setWalletsLoading(true);
|
|
62
|
+
try {
|
|
63
|
+
const listRes = await (0, api_1.fetchApi)('/auth/wallet/list');
|
|
64
|
+
if (!listRes.success || !listRes.data?.wallets) {
|
|
65
|
+
setWalletMCDs([]);
|
|
66
|
+
setWalletsLoading(false);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const wallets = listRes.data.wallets;
|
|
70
|
+
if (wallets.length === 0) {
|
|
71
|
+
setWalletMCDs([]);
|
|
72
|
+
setWalletsLoading(false);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const results = await Promise.allSettled(wallets.map(async (w) => {
|
|
76
|
+
const wb = await (0, blockchain_1.getWalletBalance)(w.wallet_address);
|
|
77
|
+
const mcdToken = (0, blockchain_1.getTokenFromBalance)(wb, 'MCD');
|
|
78
|
+
return {
|
|
79
|
+
address: w.wallet_address,
|
|
80
|
+
balance: mcdToken?.balance || 0,
|
|
81
|
+
isPrimary: !!w.is_primary
|
|
82
|
+
};
|
|
83
|
+
}));
|
|
84
|
+
const infos = [];
|
|
85
|
+
for (const r of results) {
|
|
86
|
+
if (r.status === 'fulfilled')
|
|
87
|
+
infos.push(r.value);
|
|
88
|
+
}
|
|
89
|
+
setWalletMCDs(infos);
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
setWalletMCDs([]);
|
|
93
|
+
}
|
|
94
|
+
finally {
|
|
95
|
+
setWalletsLoading(false);
|
|
96
|
+
}
|
|
97
|
+
}, []);
|
|
98
|
+
(0, react_1.useEffect)(() => {
|
|
99
|
+
if (user?.uid)
|
|
100
|
+
loadOnChainMCD();
|
|
101
|
+
}, [user?.uid, loadOnChainMCD]);
|
|
102
|
+
const totalOnChainMCD = walletMCDs.reduce((sum, w) => sum + w.balance, 0);
|
|
103
|
+
if (!user) {
|
|
104
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center h-[60vh]", children: (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-8 text-center", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "w-12 h-12 mx-auto mb-4 text-neutral-500" }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400", children: t('loginRequired') })] }) }) }));
|
|
105
|
+
}
|
|
106
|
+
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", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-lg sm:text-2xl font-bold text-white tracking-wider", children: t('title') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400 mt-1", children: t('subtitle') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(navigation_1.Link, { href: "/mcc/wallet", children: (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "w-4 h-4 mr-2" }), t('manageWallet')] }) }), (0, jsx_runtime_1.jsxs)(dialog_1.Dialog, { open: showHelp, onOpenChange: setShowHelp, children: [(0, jsx_runtime_1.jsx)(dialog_1.DialogTrigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.HelpCircle, { className: "w-4 h-4 mr-2" }), t('helpGuide')] }) }), (0, jsx_runtime_1.jsxs)(dialog_1.DialogContent, { className: "bg-neutral-900 border-neutral-700 max-w-lg", children: [(0, jsx_runtime_1.jsxs)(dialog_1.DialogHeader, { children: [(0, jsx_runtime_1.jsx)(dialog_1.DialogTitle, { className: "text-white tracking-wider", children: t('helpTitle') }), (0, jsx_runtime_1.jsx)(dialog_1.DialogDescription, { className: "text-neutral-400", children: t('helpDesc') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-4 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-3", children: [(0, jsx_runtime_1.jsxs)("h4", { className: "font-medium text-white mb-2 flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Gift, { className: "w-4 h-4 text-white" }), t('howToGetMcd')] }), (0, jsx_runtime_1.jsxs)("ul", { className: "list-disc list-inside text-neutral-400 space-y-1", children: [(0, jsx_runtime_1.jsx)("li", { children: t('helpGet1') }), (0, jsx_runtime_1.jsx)("li", { children: t('helpGet2') }), (0, jsx_runtime_1.jsx)("li", { children: t('helpGet3') })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-3", children: [(0, jsx_runtime_1.jsxs)("h4", { className: "font-medium text-white mb-2 flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Coins, { className: "w-4 h-4 text-white" }), t('mcdUsage')] }), (0, jsx_runtime_1.jsxs)("ul", { className: "list-disc list-inside text-neutral-400 space-y-1", children: [(0, jsx_runtime_1.jsx)("li", { children: t('helpUse1') }), (0, jsx_runtime_1.jsx)("li", { children: t('helpUse2') }), (0, jsx_runtime_1.jsx)("li", { children: t('helpUse3') })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-3", children: [(0, jsx_runtime_1.jsxs)("h4", { className: "font-medium text-white mb-2 flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.History, { className: "w-4 h-4 text-white" }), t('notes')] }), (0, jsx_runtime_1.jsxs)("ul", { className: "list-disc list-inside text-neutral-400 space-y-1", children: [(0, jsx_runtime_1.jsx)("li", { children: t('helpNote1') }), (0, jsx_runtime_1.jsx)("li", { children: t('helpNote2') }), (0, jsx_runtime_1.jsx)("li", { children: t('helpNote3') })] })] })] })] })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", onClick: () => { refresh(); loadOnChainMCD(); }, disabled: isRefreshing || walletsLoading, className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: `w-4 h-4 mr-2 ${(isRefreshing || walletsLoading) ? 'animate-spin' : ''}` }), t('refresh')] })] })] }), error && ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-red-500/10 border-red-500/30", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-4", children: (0, jsx_runtime_1.jsx)("p", { className: "text-red-400 text-sm", children: error }) }) })), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", 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-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Coins, { className: "w-5 h-5 text-white" }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm text-neutral-400 tracking-wider", children: t('onChainBalance') })] }), walletMCDs.length > 1 && ((0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "ghost", size: "sm", onClick: () => setWalletsExpanded(!walletsExpanded), className: "text-neutral-400 hover:text-cyan-400", children: [walletMCDs.length, " ", t('walletsCount'), walletsExpanded
|
|
107
|
+
? (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronUp, { className: "w-4 h-4 ml-1" })
|
|
108
|
+
: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "w-4 h-4 ml-1" })] }))] }), walletsLoading ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-5 h-5 animate-spin text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 text-sm", children: t('loadingOnChain') })] })) : walletMCDs.length === 0 ? ((0, jsx_runtime_1.jsxs)("div", { className: "text-center py-4", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 mb-3", children: t('noWalletBound') }), (0, jsx_runtime_1.jsx)(navigation_1.Link, { href: "/mcc/wallet", children: (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "w-4 h-4 mr-2" }), t('connectWallet')] }) })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-4xl font-bold text-white font-mono mb-1", children: [totalOnChainMCD.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 }), (0, jsx_runtime_1.jsx)("span", { className: "text-lg text-neutral-400 ml-2", children: "MCD" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-500", children: [walletMCDs.length, " ", t('walletsCount'), "\u7684\u94FE\u4E0A\u4F59\u989D\u603B\u548C"] }), walletMCDs.length === 1 && ((0, jsx_runtime_1.jsxs)("div", { className: "mt-2 text-xs text-neutral-500 font-mono", children: [walletMCDs[0].address.slice(0, 4), "...", walletMCDs[0].address.slice(-4), walletMCDs[0].isPrimary && ((0, jsx_runtime_1.jsx)(badge_1.Badge, { variant: "outline", className: "text-[10px] border-cyan-400/30 text-cyan-400 px-1.5 py-0 ml-2", children: t('primaryWallet') }))] })), walletsExpanded && walletMCDs.length > 1 && ((0, jsx_runtime_1.jsx)("div", { className: "mt-4 space-y-2 border-t border-neutral-700 pt-4", children: walletMCDs.map((w) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between p-2 bg-neutral-800 rounded hover:bg-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-xs font-mono text-neutral-400", children: [w.address.slice(0, 4), "...", w.address.slice(-4)] }), w.isPrimary && ((0, jsx_runtime_1.jsx)(badge_1.Badge, { variant: "outline", className: "text-[10px] border-cyan-400/30 text-cyan-400 px-1.5 py-0", children: t('primaryWallet') }))] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-sm font-mono text-white", children: [w.balance.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 }), " MCD"] })] }, w.address))) }))] }))] }) }), (0, jsx_runtime_1.jsxs)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: [(0, jsx_runtime_1.jsxs)(card_1.CardHeader, { children: [(0, jsx_runtime_1.jsxs)(card_1.CardTitle, { className: "text-sm font-medium text-neutral-300 tracking-wider flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.TrendingUp, { className: "w-5 h-5 text-white" }), t('mcdMinting')] }), (0, jsx_runtime_1.jsx)(card_1.CardDescription, { className: "text-neutral-400", children: t('mcdMintingDesc') })] }), (0, jsx_runtime_1.jsxs)(card_1.CardContent, { children: [(0, jsx_runtime_1.jsx)(navigation_1.Link, { href: "/mcc/mining", children: (0, jsx_runtime_1.jsxs)("div", { className: "w-full flex items-center justify-center gap-2 h-10 rounded-md cursor-pointer bg-cyan-700 hover:bg-cyan-600 transition-all text-white text-sm font-medium", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Coins, { className: "w-4 h-4" }), t('useMcdToMintMcc')] }) }), (0, jsx_runtime_1.jsx)("div", { className: "mt-3 p-3 bg-neutral-800 rounded", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2 text-xs text-cyan-400/70", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertTriangle, { className: "w-3.5 h-3.5 mt-0.5 shrink-0 text-cyan-400" }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-1", children: [(0, jsx_runtime_1.jsx)("p", { children: t('whitelistNote1') }), (0, jsx_runtime_1.jsx)("p", { children: t('whitelistNote2') })] })] }) })] })] }), (0, jsx_runtime_1.jsxs)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: [(0, jsx_runtime_1.jsxs)(card_1.CardHeader, { children: [(0, jsx_runtime_1.jsxs)(card_1.CardTitle, { className: "text-sm font-medium text-neutral-300 tracking-wider flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Gift, { className: "w-5 h-5 text-white" }), t('ecoServices')] }), (0, jsx_runtime_1.jsx)(card_1.CardDescription, { className: "text-neutral-400", children: t('ecoServicesDesc') })] }), (0, jsx_runtime_1.jsx)(card_1.CardContent, { children: (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
109
|
+
{ name: 'Double Helix', tagline: t('dhTagline'), desc: t('dhDesc'), icon: lucide_react_1.TrendingUp, iconBg: 'bg-cyan-400/20', iconColor: 'text-cyan-400', status: t('statusRunning'), statusColor: 'text-white', url: 'https://doublehelix.money' },
|
|
110
|
+
{ name: 'xSocial', tagline: t('xsTagline'), desc: t('xsDesc'), icon: lucide_react_1.MessageSquare, iconBg: 'bg-cyan-400/20', iconColor: 'text-cyan-400', status: t('statusBeta'), statusColor: 'text-cyan-400', url: 'https://xsocial.cc' },
|
|
111
|
+
{ name: 'Event Horizon', tagline: t('ehTagline'), desc: t('ehDesc'), icon: lucide_react_1.Eye, iconBg: 'bg-cyan-400/20', iconColor: 'text-cyan-400', status: t('statusBeta'), statusColor: 'text-cyan-400', url: 'https://poly.microcosm.money' },
|
|
112
|
+
{ name: 'GreenSwans', tagline: 'Crypto Guardian', desc: t('gsDesc'), icon: lucide_react_1.Shield, iconBg: 'bg-cyan-400/20', iconColor: 'text-cyan-400', status: t('statusDev'), statusColor: 'text-neutral-400', url: 'https://greenswans.cc' },
|
|
113
|
+
].map((p) => ((0, jsx_runtime_1.jsxs)("a", { href: p.url, target: "_blank", rel: "noopener noreferrer", className: "block p-4 bg-neutral-800 rounded-lg hover:bg-neutral-700 transition-colors group", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 mb-3", children: [(0, jsx_runtime_1.jsx)("div", { className: `w-10 h-10 rounded-lg ${p.iconBg} flex items-center justify-center`, children: (0, jsx_runtime_1.jsx)(p.icon, { className: `w-5 h-5 ${p.iconColor}` }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 min-w-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-medium text-white text-sm", children: p.name }), (0, jsx_runtime_1.jsx)(lucide_react_1.ExternalLink, { className: "w-3 h-3 text-neutral-600 opacity-0 group-hover:opacity-100 transition-opacity" })] }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-500", children: p.tagline })] }), (0, jsx_runtime_1.jsx)("span", { className: `text-[10px] ${p.statusColor}`, children: p.status })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-400 leading-relaxed", children: p.desc })] }, p.name))) }) })] }), (0, jsx_runtime_1.jsxs)(tabs_1.Tabs, { defaultValue: "daily", className: "space-y-4", children: [(0, jsx_runtime_1.jsxs)(tabs_1.TabsList, { className: "bg-neutral-800 border border-neutral-700", children: [(0, jsx_runtime_1.jsxs)(tabs_1.TabsTrigger, { value: "daily", className: "data-[state=active]:bg-neutral-700", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Gift, { className: "w-4 h-4 mr-2" }), t('dailyDistribution')] }), (0, jsx_runtime_1.jsxs)(tabs_1.TabsTrigger, { value: "transactions", className: "data-[state=active]:bg-neutral-700", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.History, { className: "w-4 h-4 mr-2" }), t('transactionHistory')] })] }), (0, jsx_runtime_1.jsx)(tabs_1.TabsContent, { value: "daily", children: (0, jsx_runtime_1.jsxs)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: [(0, jsx_runtime_1.jsxs)(card_1.CardHeader, { children: [(0, jsx_runtime_1.jsxs)(card_1.CardTitle, { className: "text-sm font-medium text-neutral-300 tracking-wider flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Calendar, { className: "w-5 h-5 text-white" }), t('dailyDistributionRecords')] }), (0, jsx_runtime_1.jsx)(card_1.CardDescription, { className: "text-neutral-400", children: t('dailyDistributionDesc') })] }), (0, jsx_runtime_1.jsx)(card_1.CardContent, { children: dbLoading ? ((0, jsx_runtime_1.jsx)("div", { className: "space-y-3", children: [...Array(5)].map((_, i) => ((0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { className: "h-12 w-full bg-neutral-800" }, i))) })) : dailyRewards.length === 0 ? ((0, jsx_runtime_1.jsxs)("div", { className: "text-center py-12 text-neutral-500", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Gift, { className: "w-12 h-12 mx-auto mb-4 opacity-50" }), (0, jsx_runtime_1.jsx)("p", { children: t('noDailyRecords') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm mt-2", children: t('noDailyRecordsHint') })] })) : ((0, jsx_runtime_1.jsx)("div", { className: "overflow-x-auto", children: (0, jsx_runtime_1.jsxs)(table_1.Table, { children: [(0, jsx_runtime_1.jsx)(table_1.TableHeader, { children: (0, jsx_runtime_1.jsxs)(table_1.TableRow, { className: "border-neutral-800 hover:bg-transparent", children: [(0, jsx_runtime_1.jsx)(table_1.TableHead, { className: "text-xs font-medium text-neutral-400 tracking-wider", children: t('distributionDate') }), (0, jsx_runtime_1.jsx)(table_1.TableHead, { className: "text-xs font-medium text-neutral-400 tracking-wider", children: "Station" }), (0, jsx_runtime_1.jsx)(table_1.TableHead, { className: "text-xs font-medium text-neutral-400 tracking-wider text-right", children: t('amountLabel') }), (0, jsx_runtime_1.jsx)(table_1.TableHead, { className: "text-xs font-medium text-neutral-400 tracking-wider text-right", children: t('claimTime') })] }) }), (0, jsx_runtime_1.jsx)(table_1.TableBody, { children: dailyRewards.map((reward) => ((0, jsx_runtime_1.jsxs)(table_1.TableRow, { className: "border-b border-neutral-800 hover:bg-neutral-800", children: [(0, jsx_runtime_1.jsx)(table_1.TableCell, { className: "font-medium text-white font-mono", children: formatShortDate(reward.reward_date) }), (0, jsx_runtime_1.jsx)(table_1.TableCell, { className: "text-neutral-400 font-mono", children: reward.territory_id || '-' }), (0, jsx_runtime_1.jsx)(table_1.TableCell, { className: "text-right", children: (0, jsx_runtime_1.jsxs)("span", { className: "text-white font-medium font-mono", children: ["+", reward.mcd_received.toLocaleString(), " MCD"] }) }), (0, jsx_runtime_1.jsx)(table_1.TableCell, { className: "text-right text-neutral-500 text-sm font-mono", children: formatDate(reward.created_at) })] }, reward.id))) })] }) })) })] }) }), (0, jsx_runtime_1.jsx)(tabs_1.TabsContent, { value: "transactions", children: (0, jsx_runtime_1.jsxs)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: [(0, jsx_runtime_1.jsxs)(card_1.CardHeader, { children: [(0, jsx_runtime_1.jsxs)(card_1.CardTitle, { className: "text-sm font-medium text-neutral-300 tracking-wider flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.History, { className: "w-5 h-5 text-white" }), t('transactionHistory')] }), (0, jsx_runtime_1.jsx)(card_1.CardDescription, { className: "text-neutral-400", children: t('transactionHistoryDesc') })] }), (0, jsx_runtime_1.jsx)(card_1.CardContent, { children: dbLoading ? ((0, jsx_runtime_1.jsx)("div", { className: "space-y-3", children: [...Array(5)].map((_, i) => ((0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { className: "h-12 w-full bg-neutral-800" }, i))) })) : transactions.length === 0 ? ((0, jsx_runtime_1.jsxs)("div", { className: "text-center py-12 text-neutral-500", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.History, { className: "w-12 h-12 mx-auto mb-4 opacity-50" }), (0, jsx_runtime_1.jsx)("p", { children: t('noTransactions') })] })) : ((0, jsx_runtime_1.jsx)("div", { className: "overflow-x-auto", children: (0, jsx_runtime_1.jsxs)(table_1.Table, { children: [(0, jsx_runtime_1.jsx)(table_1.TableHeader, { children: (0, jsx_runtime_1.jsxs)(table_1.TableRow, { className: "border-neutral-800 hover:bg-transparent", children: [(0, jsx_runtime_1.jsx)(table_1.TableHead, { className: "text-xs font-medium text-neutral-400 tracking-wider", children: t('timeLabel') }), (0, jsx_runtime_1.jsx)(table_1.TableHead, { className: "text-xs font-medium text-neutral-400 tracking-wider", children: t('typeLabel') }), (0, jsx_runtime_1.jsx)(table_1.TableHead, { className: "text-xs font-medium text-neutral-400 tracking-wider", children: t('fromLabel') }), (0, jsx_runtime_1.jsx)(table_1.TableHead, { className: "text-xs font-medium text-neutral-400 tracking-wider w-8" }), (0, jsx_runtime_1.jsx)(table_1.TableHead, { className: "text-xs font-medium text-neutral-400 tracking-wider", children: t('toLabel') }), (0, jsx_runtime_1.jsx)(table_1.TableHead, { className: "text-xs font-medium text-neutral-400 tracking-wider text-right", children: t('amountLabel') })] }) }), (0, jsx_runtime_1.jsx)(table_1.TableBody, { children: transactions.map((tx) => {
|
|
114
|
+
const isIncome = tx.to_account_id === user?.uid;
|
|
115
|
+
return ((0, jsx_runtime_1.jsxs)(table_1.TableRow, { className: "border-b border-neutral-800 hover:bg-neutral-800", children: [(0, jsx_runtime_1.jsx)(table_1.TableCell, { className: "text-neutral-500 text-sm font-mono", children: formatDate(tx.created_at) }), (0, jsx_runtime_1.jsx)(table_1.TableCell, { children: (0, jsx_runtime_1.jsx)(badge_1.Badge, { variant: "outline", className: TX_TYPE_COLORS[tx.tx_type] || 'bg-neutral-500/20 text-neutral-300', children: TX_TYPE_NAMES[tx.tx_type] || tx.tx_type }) }), (0, jsx_runtime_1.jsx)(table_1.TableCell, { className: "text-neutral-400 text-sm font-mono", children: tx.from_account_type === 'station_vault'
|
|
116
|
+
? `Station #${tx.from_account_id}`
|
|
117
|
+
: tx.from_account_type === 'system'
|
|
118
|
+
? t('system')
|
|
119
|
+
: `${t('userLabel')} ${tx.from_account_id?.slice(0, 8)}...` }), (0, jsx_runtime_1.jsx)(table_1.TableCell, { className: "text-neutral-600", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ArrowRight, { className: "w-4 h-4" }) }), (0, jsx_runtime_1.jsx)(table_1.TableCell, { className: "text-neutral-400 text-sm font-mono", children: tx.to_account_type === 'station_vault'
|
|
120
|
+
? `Station #${tx.to_account_id}`
|
|
121
|
+
: tx.to_account_type === 'system'
|
|
122
|
+
? t('system')
|
|
123
|
+
: `${t('userLabel')} ${tx.to_account_id?.slice(0, 8)}...` }), (0, jsx_runtime_1.jsx)(table_1.TableCell, { className: "text-right", children: (0, jsx_runtime_1.jsxs)("span", { className: `font-medium font-mono ${isIncome ? 'text-white' : 'text-red-400'}`, children: [isIncome ? '+' : '-', tx.amount.toLocaleString(), " MCD"] }) })] }, tx.id));
|
|
124
|
+
}) })] }) })) })] }) })] })] }));
|
|
125
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function MessagesPage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
"use client";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.default = MessagesPage;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const card_1 = require("../ui/card");
|
|
8
|
+
const lucide_react_1 = require("lucide-react");
|
|
9
|
+
const next_intl_1 = require("next-intl");
|
|
10
|
+
function MessagesPage() {
|
|
11
|
+
const t = (0, next_intl_1.useTranslations)('messages');
|
|
12
|
+
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", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-lg sm:text-2xl font-bold text-white tracking-wider", children: t('title') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400", children: t('subtitle') })] }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-8 text-center", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.MessageSquare, { className: "w-12 h-12 mx-auto mb-4 text-neutral-500" }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500", children: t('noMessages') })] }) })] }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface DistributionHistoryProps {
|
|
2
|
+
uid?: string;
|
|
3
|
+
territoryId?: string;
|
|
4
|
+
source?: 'x402' | 'cronjob';
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
showUserColumn?: boolean;
|
|
8
|
+
limit?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function MiningDistributionHistory({ uid, territoryId, source, title, description, showUserColumn, limit }: DistributionHistoryProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default MiningDistributionHistory;
|