@microcosmmoney/portal-react 3.12.8 → 3.13.1
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 +136 -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/useMultiWalletBalance.d.ts +31 -0
- package/dist/main-portal/hooks/useMultiWalletBalance.js +65 -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/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/index.d.ts +9 -0
- package/dist/main-portal/lib/api/index.js +37 -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-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/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,341 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
'use client';
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.default = StationListPage;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const navigation_1 = require("next/navigation");
|
|
9
|
+
const card_1 = require("../ui/card");
|
|
10
|
+
const badge_1 = require("../ui/badge");
|
|
11
|
+
const button_1 = require("../ui/button");
|
|
12
|
+
const dialog_1 = require("../ui/dialog");
|
|
13
|
+
const sonner_1 = require("sonner");
|
|
14
|
+
const useAuth_1 = require("../../hooks/useAuth");
|
|
15
|
+
const auth_service_1 = require("../../lib/auth-service");
|
|
16
|
+
const hover_avatar_1 = require("../ui/hover-avatar");
|
|
17
|
+
const api_service_1 = require("../../lib/api-service");
|
|
18
|
+
const lucide_react_1 = require("lucide-react");
|
|
19
|
+
const next_intl_1 = require("next-intl");
|
|
20
|
+
const getUnitTypeIcon = (type, className = 'w-4 h-4') => {
|
|
21
|
+
switch (type) {
|
|
22
|
+
case 'station': return (0, jsx_runtime_1.jsx)(lucide_react_1.Building2, { className: className });
|
|
23
|
+
case 'matrix': return (0, jsx_runtime_1.jsx)(lucide_react_1.Grid3x3, { className: className });
|
|
24
|
+
case 'sector': return (0, jsx_runtime_1.jsx)(lucide_react_1.Map, { className: className });
|
|
25
|
+
case 'system': return (0, jsx_runtime_1.jsx)(lucide_react_1.Globe, { className: className });
|
|
26
|
+
default: return (0, jsx_runtime_1.jsx)(lucide_react_1.Building2, { className: className });
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const getTechBonusPercentage = (type) => {
|
|
30
|
+
switch (type) {
|
|
31
|
+
case 'station': return 10;
|
|
32
|
+
case 'matrix': return 20;
|
|
33
|
+
case 'sector': return 30;
|
|
34
|
+
case 'system': return 40;
|
|
35
|
+
default: return 0;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const getMagistrateTitle = (type) => {
|
|
39
|
+
switch (type) {
|
|
40
|
+
case 'station': return 'Commander';
|
|
41
|
+
case 'matrix': return 'Pioneer';
|
|
42
|
+
case 'sector': return 'Warden';
|
|
43
|
+
case 'system': return 'Admiral';
|
|
44
|
+
default: return 'Magistrate';
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const cropToSquare = (file, size) => {
|
|
48
|
+
return new Promise((resolve, reject) => {
|
|
49
|
+
const img = new Image();
|
|
50
|
+
img.onload = () => {
|
|
51
|
+
const canvas = document.createElement('canvas');
|
|
52
|
+
canvas.width = size;
|
|
53
|
+
canvas.height = size;
|
|
54
|
+
const ctx = canvas.getContext('2d');
|
|
55
|
+
if (!ctx) {
|
|
56
|
+
reject(new Error('Canvas not supported'));
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const side = Math.min(img.width, img.height);
|
|
60
|
+
const sx = (img.width - side) / 2;
|
|
61
|
+
const sy = (img.height - side) / 2;
|
|
62
|
+
ctx.drawImage(img, sx, sy, side, side, 0, 0, size, size);
|
|
63
|
+
canvas.toBlob((blob) => {
|
|
64
|
+
if (!blob) {
|
|
65
|
+
reject(new Error('Blob creation failed'));
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
resolve(new File([blob], file.name, { type: 'image/jpeg' }));
|
|
69
|
+
}, 'image/jpeg', 0.85);
|
|
70
|
+
};
|
|
71
|
+
img.onerror = () => reject(new Error('Image load failed'));
|
|
72
|
+
img.src = URL.createObjectURL(file);
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
function StationListPage() {
|
|
76
|
+
const t = (0, next_intl_1.useTranslations)('stationList');
|
|
77
|
+
const router = (0, navigation_1.useRouter)();
|
|
78
|
+
const { isAdmin, user } = (0, useAuth_1.useAuth)();
|
|
79
|
+
const [units, setUnits] = (0, react_1.useState)([]);
|
|
80
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
81
|
+
const [filter, setFilter] = (0, react_1.useState)('all');
|
|
82
|
+
const [searchTerm, setSearchTerm] = (0, react_1.useState)('');
|
|
83
|
+
const [unitDataCache, setUnitDataCache] = (0, react_1.useState)({});
|
|
84
|
+
const [summary, setSummary] = (0, react_1.useState)(null);
|
|
85
|
+
const [isEditDialogOpen, setIsEditDialogOpen] = (0, react_1.useState)(false);
|
|
86
|
+
const [editingUnit, setEditingUnit] = (0, react_1.useState)(null);
|
|
87
|
+
const [editFormData, setEditFormData] = (0, react_1.useState)({ unit_name: '', description: '' });
|
|
88
|
+
const [submitting, setSubmitting] = (0, react_1.useState)(false);
|
|
89
|
+
const [imageFile, setImageFile] = (0, react_1.useState)(null);
|
|
90
|
+
const [imagePreview, setImagePreview] = (0, react_1.useState)(null);
|
|
91
|
+
const [uploadingImage, setUploadingImage] = (0, react_1.useState)(false);
|
|
92
|
+
const fileInputRef = (0, react_1.useRef)(null);
|
|
93
|
+
const getUnitTypeLabel = (type) => {
|
|
94
|
+
switch (type) {
|
|
95
|
+
case 'station': return t('station');
|
|
96
|
+
case 'matrix': return t('matrix');
|
|
97
|
+
case 'sector': return t('sector');
|
|
98
|
+
case 'system': return t('system');
|
|
99
|
+
default: return type;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const getImageStatusBadge = (status) => {
|
|
103
|
+
if (status === 'pending')
|
|
104
|
+
return (0, jsx_runtime_1.jsxs)(badge_1.Badge, { className: "bg-yellow-400/20 text-yellow-400 text-[10px]", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Clock, { className: "w-2.5 h-2.5 mr-0.5" }), t('reviewPending')] });
|
|
105
|
+
if (status === 'rejected')
|
|
106
|
+
return (0, jsx_runtime_1.jsxs)(badge_1.Badge, { className: "bg-red-400/20 text-red-400 text-[10px]", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.XCircle, { className: "w-2.5 h-2.5 mr-0.5" }), t('reviewRejected')] });
|
|
107
|
+
return null;
|
|
108
|
+
};
|
|
109
|
+
(0, react_1.useEffect)(() => { loadUnits(); loadSummary(); }, [filter]);
|
|
110
|
+
const loadSummary = async () => {
|
|
111
|
+
try {
|
|
112
|
+
const response = await (0, api_service_1.getUnitsSummary)();
|
|
113
|
+
if (response.success) {
|
|
114
|
+
const flat = response;
|
|
115
|
+
const summaryData = response.data || {
|
|
116
|
+
total_stations: flat.total_stations,
|
|
117
|
+
total_members: flat.total_members,
|
|
118
|
+
total_vault_balance: flat.total_vault_balance,
|
|
119
|
+
total_vault_mcd: flat.total_vault_mcd,
|
|
120
|
+
avg_kpi_score: flat.avg_kpi_score,
|
|
121
|
+
stations_by_type: flat.stations_by_type,
|
|
122
|
+
};
|
|
123
|
+
setSummary(summaryData);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
console.error('Failed to load summary:', error);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
const loadUnits = async () => {
|
|
131
|
+
try {
|
|
132
|
+
setLoading(true);
|
|
133
|
+
const filterParam = filter === 'all' ? undefined : filter;
|
|
134
|
+
const response = await (0, api_service_1.getUnits)(filterParam);
|
|
135
|
+
if (response.success && response.data) {
|
|
136
|
+
setUnits(response.data);
|
|
137
|
+
for (const unit of response.data) {
|
|
138
|
+
loadUnitData(unit.unit_id);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
sonner_1.toast.error(t('loadFailed'));
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
sonner_1.toast.error(error instanceof Error ? error.message : t('loadFailed'));
|
|
147
|
+
}
|
|
148
|
+
finally {
|
|
149
|
+
setLoading(false);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
const loadUnitData = async (unitId) => {
|
|
153
|
+
try {
|
|
154
|
+
const response = await (0, api_service_1.getUnitDetailedStats)(unitId);
|
|
155
|
+
if (response.success && response.data) {
|
|
156
|
+
const { metrics } = response.data;
|
|
157
|
+
setUnitDataCache(prev => ({
|
|
158
|
+
...prev,
|
|
159
|
+
[unitId]: {
|
|
160
|
+
memberCount: metrics.member_count,
|
|
161
|
+
maxCapacity: metrics.max_capacity,
|
|
162
|
+
vaultBalance: metrics.vault_mcd ?? 0,
|
|
163
|
+
occupancyRate: metrics.occupancy_rate,
|
|
164
|
+
},
|
|
165
|
+
}));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
console.error(`Failed to load unit ${unitId} data:`, error);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
const filteredUnits = units.filter(unit => {
|
|
173
|
+
const lowerSearch = searchTerm.toLowerCase();
|
|
174
|
+
return unit.unit_name.toLowerCase().includes(lowerSearch) ||
|
|
175
|
+
(unit.description?.toLowerCase().includes(lowerSearch)) ||
|
|
176
|
+
(unit.location?.toLowerCase().includes(lowerSearch)) ||
|
|
177
|
+
(unit.short_id?.toLowerCase().includes(lowerSearch)) ||
|
|
178
|
+
(unit.full_path?.toLowerCase().includes(lowerSearch));
|
|
179
|
+
});
|
|
180
|
+
const canEditUnit = (unit) => {
|
|
181
|
+
if (isAdmin())
|
|
182
|
+
return true;
|
|
183
|
+
if (user?.uid && (unit.manager_uid === user.uid || unit.manager_id === user.uid))
|
|
184
|
+
return true;
|
|
185
|
+
return false;
|
|
186
|
+
};
|
|
187
|
+
const handleFileSelect = (0, react_1.useCallback)((e) => {
|
|
188
|
+
const file = e.target.files?.[0];
|
|
189
|
+
if (!file)
|
|
190
|
+
return;
|
|
191
|
+
if (!file.type.startsWith('image/')) {
|
|
192
|
+
sonner_1.toast.error(t('imageSelectError'));
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (file.size > 2 * 1024 * 1024) {
|
|
196
|
+
sonner_1.toast.error(t('imageSizeError'));
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
cropToSquare(file, 512).then(cropped => {
|
|
200
|
+
setImageFile(cropped);
|
|
201
|
+
const reader = new FileReader();
|
|
202
|
+
reader.onload = (ev) => setImagePreview(ev.target?.result);
|
|
203
|
+
reader.readAsDataURL(cropped);
|
|
204
|
+
}).catch(() => sonner_1.toast.error(t('imageProcessError')));
|
|
205
|
+
}, [t]);
|
|
206
|
+
const handleImageUpload = async (unitId) => {
|
|
207
|
+
if (!imageFile)
|
|
208
|
+
return true;
|
|
209
|
+
setUploadingImage(true);
|
|
210
|
+
try {
|
|
211
|
+
const token = await (0, auth_service_1.getCurrentUserToken)();
|
|
212
|
+
if (!token)
|
|
213
|
+
throw new Error(t('notLoggedIn'));
|
|
214
|
+
const formData = new FormData();
|
|
215
|
+
formData.append('image', imageFile, imageFile.name);
|
|
216
|
+
const response = await fetch(`/api/territories/${unitId}/image`, {
|
|
217
|
+
method: 'POST',
|
|
218
|
+
headers: { Authorization: `Bearer ${token}` },
|
|
219
|
+
body: formData,
|
|
220
|
+
});
|
|
221
|
+
if (!response.ok) {
|
|
222
|
+
const err = await response.json();
|
|
223
|
+
throw new Error(err.error || t('imageUploadFailed'));
|
|
224
|
+
}
|
|
225
|
+
return true;
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
sonner_1.toast.error(error instanceof Error ? error.message : t('imageUploadFailed'));
|
|
229
|
+
return false;
|
|
230
|
+
}
|
|
231
|
+
finally {
|
|
232
|
+
setUploadingImage(false);
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
const handleImageReview = async (unitId, status) => {
|
|
236
|
+
try {
|
|
237
|
+
const token = await (0, auth_service_1.getCurrentUserToken)();
|
|
238
|
+
if (!token)
|
|
239
|
+
return;
|
|
240
|
+
const response = await fetch(`/api/territories/${unitId}/image/review`, {
|
|
241
|
+
method: 'PUT',
|
|
242
|
+
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
|
|
243
|
+
body: JSON.stringify({ status }),
|
|
244
|
+
});
|
|
245
|
+
if (response.ok) {
|
|
246
|
+
sonner_1.toast.success(status === 'approved' ? t('reviewSuccess') : t('reviewRejectSuccess'));
|
|
247
|
+
loadUnits();
|
|
248
|
+
if (editingUnit && editingUnit.unit_id === unitId) {
|
|
249
|
+
setEditingUnit({ ...editingUnit, image_status: status });
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
sonner_1.toast.error(t('reviewFailed'));
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
catch {
|
|
257
|
+
sonner_1.toast.error(t('reviewFailed'));
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
const handleEdit = async () => {
|
|
261
|
+
if (!editingUnit)
|
|
262
|
+
return;
|
|
263
|
+
if (!editFormData.unit_name.trim()) {
|
|
264
|
+
sonner_1.toast.error(t('unitNameRequired'));
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
try {
|
|
268
|
+
setSubmitting(true);
|
|
269
|
+
if (imageFile) {
|
|
270
|
+
const uploadOk = await handleImageUpload(editingUnit.unit_id);
|
|
271
|
+
if (!uploadOk) {
|
|
272
|
+
setSubmitting(false);
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
const response = await (0, api_service_1.updateUnit)(editingUnit.unit_id, {
|
|
277
|
+
unit_name: editFormData.unit_name,
|
|
278
|
+
description: editFormData.description,
|
|
279
|
+
});
|
|
280
|
+
if (response.success) {
|
|
281
|
+
sonner_1.toast.success(t('updateSuccess'));
|
|
282
|
+
setIsEditDialogOpen(false);
|
|
283
|
+
setEditingUnit(null);
|
|
284
|
+
setImageFile(null);
|
|
285
|
+
setImagePreview(null);
|
|
286
|
+
loadUnits();
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
sonner_1.toast.error(response.error || t('updateFailed'));
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
catch (error) {
|
|
293
|
+
sonner_1.toast.error(error instanceof Error ? error.message : t('updateFailed'));
|
|
294
|
+
}
|
|
295
|
+
finally {
|
|
296
|
+
setSubmitting(false);
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
const openEditDialog = (unit, e) => {
|
|
300
|
+
e.stopPropagation();
|
|
301
|
+
setEditingUnit(unit);
|
|
302
|
+
setEditFormData({
|
|
303
|
+
unit_name: unit.unit_name,
|
|
304
|
+
description: unit.description || '',
|
|
305
|
+
});
|
|
306
|
+
setImageFile(null);
|
|
307
|
+
setImagePreview(null);
|
|
308
|
+
setIsEditDialogOpen(true);
|
|
309
|
+
};
|
|
310
|
+
const handleCardClick = (unit) => {
|
|
311
|
+
const urlId = unit.short_id || unit.territory_id || unit.unit_id;
|
|
312
|
+
router.push(`/user-system/territory/${urlId}`);
|
|
313
|
+
};
|
|
314
|
+
const getManagerDisplay = (unit) => {
|
|
315
|
+
const title = getMagistrateTitle(unit.unit_type);
|
|
316
|
+
if (unit.manager_wallet) {
|
|
317
|
+
return { title, subtitle: unit.manager_display_name || t('magistrate'), avatar: unit.manager_avatar_url };
|
|
318
|
+
}
|
|
319
|
+
return { title, subtitle: t('foundation'), avatar: null };
|
|
320
|
+
};
|
|
321
|
+
if (loading)
|
|
322
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center py-12", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-6 h-6 animate-spin text-neutral-400" }), (0, jsx_runtime_1.jsx)("span", { className: "ml-2 text-neutral-400 text-sm", children: "loading territories..." })] }));
|
|
323
|
+
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", { 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: "grid grid-cols-2 lg:grid-cols-4 gap-4", children: [(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.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "total_territories" }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-white font-mono", children: summary?.total_stations ?? 0 })] }) }), (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.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "total_members" }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-white font-mono", children: summary?.total_members ?? 0 })] }) }), (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.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "total_vault_mcd" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-2xl font-bold text-white font-mono", children: [summary?.total_vault_mcd ?? 0, " ", (0, jsx_runtime_1.jsx)("span", { className: "text-sm font-normal text-neutral-500", children: "MCD" })] })] }) }), (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.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "avg_kpi" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-2xl font-bold text-white font-mono", children: [(summary?.avg_kpi_score ?? 0).toFixed(1), "%"] })] }) })] }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-3 sm:p-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col md:flex-row gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex-1 relative", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-neutral-500" }), (0, jsx_runtime_1.jsx)("input", { placeholder: t('searchPlaceholder'), value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), className: "w-full bg-neutral-800 border border-neutral-600 text-white pl-10 px-3 py-2 rounded text-sm focus:border-cyan-400 focus:outline-none placeholder:text-neutral-400" })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex gap-2 flex-wrap", children: ['all', 'station', 'matrix', 'sector', 'system'].map((f) => ((0, jsx_runtime_1.jsx)(button_1.Button, { variant: "outline", size: "sm", onClick: () => setFilter(f), className: filter === f
|
|
324
|
+
? 'bg-cyan-700 hover:bg-cyan-600 text-white border-cyan-700'
|
|
325
|
+
: 'border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent', children: f === 'all' ? t('filterAll') : getUnitTypeLabel(f) }, f))) })] }) }) }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-3 sm:p-6", children: filteredUnits.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-12 text-neutral-500 text-sm", children: t('noTerritories') })) : ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: filteredUnits.map((unit) => {
|
|
326
|
+
const unitData = unitDataCache[unit.unit_id];
|
|
327
|
+
const memberCount = unitData?.memberCount ?? 0;
|
|
328
|
+
const vaultBalance = unitData?.vaultBalance ?? 0;
|
|
329
|
+
const techBonus = getTechBonusPercentage(unit.unit_type);
|
|
330
|
+
const hasEditPermission = canEditUnit(unit);
|
|
331
|
+
const occupancyRate = unitData?.occupancyRate ?? 0;
|
|
332
|
+
return ((0, jsx_runtime_1.jsxs)("div", { onClick: () => handleCardClick(unit), className: "flex flex-col border border-neutral-700 rounded-lg cursor-pointer hover:border-cyan-400/50 transition-all group", children: [(0, jsx_runtime_1.jsxs)("div", { className: "relative flex-shrink-0 aspect-[4/3] overflow-hidden rounded-t-lg", children: [unit.image_url ? ((0, jsx_runtime_1.jsx)("img", { src: unit.image_url, alt: unit.unit_name, className: "w-full h-full object-cover group-hover:scale-105 transition-transform duration-300" })) : ((0, jsx_runtime_1.jsx)("div", { className: "w-full h-full flex items-center justify-center bg-neutral-800", children: getUnitTypeIcon(unit.unit_type, 'w-16 h-16 text-neutral-600') })), hasEditPermission && ((0, jsx_runtime_1.jsx)("button", { onClick: (e) => openEditDialog(unit, e), className: "absolute bottom-2 right-2 p-1.5 bg-neutral-900/80 hover:bg-neutral-800 text-neutral-400 hover:text-cyan-400 rounded opacity-0 group-hover:opacity-100 transition-opacity", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Edit3, { className: "w-3.5 h-3.5" }) }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-3 space-y-2 rounded-b-lg", style: { backgroundColor: '#0a0e14' }, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-300 border border-neutral-600 px-1.5 py-0.5 rounded", children: getUnitTypeLabel(unit.unit_type) }), (0, jsx_runtime_1.jsxs)("span", { className: "text-xs text-neutral-300", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Zap, { className: "w-3 h-3 inline mr-0.5" }), "+", techBonus, "%"] }), getImageStatusBadge(unit.image_status)] }), unit.short_id && ((0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400 font-mono", children: unit.short_id }))] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("span", { className: "text-white text-sm font-bold", children: unit.unit_name }), unit.full_path && ((0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500 truncate font-mono", children: unit.full_path }))] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 line-clamp-2", children: unit.description || t('noDescription') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between pt-2 border-t border-neutral-700 text-xs", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 text-neutral-400", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Users, { className: "w-3 h-3" }), (0, jsx_runtime_1.jsx)("span", { className: "text-white font-mono", children: memberCount }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500", children: "members" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 text-neutral-400", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Vault, { className: "w-3 h-3" }), (0, jsx_runtime_1.jsx)("span", { className: "text-white font-mono", children: vaultBalance.toLocaleString() }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500", children: "MCD" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-neutral-400 font-mono", children: [occupancyRate.toFixed(0), "%"] })] })] })] }, unit.unit_id));
|
|
333
|
+
}) })) }) }), (0, jsx_runtime_1.jsx)(dialog_1.Dialog, { open: isEditDialogOpen, onOpenChange: (open) => { setIsEditDialogOpen(open); if (!open) {
|
|
334
|
+
setEditingUnit(null);
|
|
335
|
+
setImageFile(null);
|
|
336
|
+
setImagePreview(null);
|
|
337
|
+
} }, children: (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('editTitle') }), (0, jsx_runtime_1.jsx)(dialog_1.DialogDescription, { className: "text-neutral-400", asChild: true, children: (0, jsx_runtime_1.jsx)("div", { children: editingUnit && ((0, jsx_runtime_1.jsxs)("span", { className: "text-xs font-mono mt-1 block", children: [getUnitTypeLabel(editingUnit.unit_type), " ", t('coordinate'), ": ", editingUnit.full_path || editingUnit.short_id || editingUnit.territory_id] })) }) })] }), editingUnit && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4 py-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex gap-4 items-start", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex-shrink-0 flex flex-col items-center justify-center self-center space-y-1.5", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-28 h-28 rounded border border-neutral-700 bg-neutral-800 overflow-hidden cursor-pointer hover:border-cyan-400/50 transition-colors relative group/img", onClick: () => fileInputRef.current?.click(), children: (imagePreview || editingUnit.image_url) ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("img", { src: imagePreview || editingUnit.image_url, alt: "", className: "w-full h-full object-cover" }), (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 bg-black/50 opacity-0 group-hover/img:opacity-100 transition-opacity flex items-center justify-center", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Upload, { className: "w-5 h-5 text-white" }) })] })) : ((0, jsx_runtime_1.jsxs)("div", { className: "w-full h-full flex flex-col items-center justify-center text-neutral-500 gap-1", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ImageIcon, { className: "w-6 h-6" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px]", children: t('clickToUpload') })] })) }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] text-neutral-500 text-center", children: "512x512 \u00B7 \u22642MB" }), !isAdmin() && (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] text-yellow-400/80 text-center", children: t('needsReview') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center gap-1 flex-wrap", children: [editingUnit.image_status && editingUnit.image_status !== 'approved' && getImageStatusBadge(editingUnit.image_status), editingUnit.image_status === 'approved' && editingUnit.image_url && ((0, jsx_runtime_1.jsxs)(badge_1.Badge, { className: "bg-green-400/20 text-green-400 text-[10px]", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "w-2.5 h-2.5 mr-0.5" }), t('approved')] })), imageFile && (0, jsx_runtime_1.jsx)(badge_1.Badge, { className: "bg-cyan-400/20 text-cyan-400 text-[10px]", children: t('newImage') })] }), isAdmin() && editingUnit.image_status === 'pending' && !imageFile && ((0, jsx_runtime_1.jsxs)("div", { className: "flex gap-1 justify-center", children: [(0, jsx_runtime_1.jsxs)(button_1.Button, { size: "sm", className: "h-5 text-[10px] bg-green-700 hover:bg-green-600 text-white px-1.5", onClick: () => handleImageReview(editingUnit.unit_id, 'approved'), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "w-2.5 h-2.5 mr-0.5" }), t('approve')] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { size: "sm", className: "h-5 text-[10px] bg-red-700 hover:bg-red-600 text-white px-1.5", onClick: () => handleImageReview(editingUnit.unit_id, 'rejected'), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.XCircle, { className: "w-2.5 h-2.5 mr-0.5" }), t('reject')] })] }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 space-y-3 min-w-0", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "unit_name *" }), (0, jsx_runtime_1.jsx)("input", { value: editFormData.unit_name, onChange: (e) => setEditFormData({ ...editFormData, unit_name: e.target.value }), className: "w-full bg-neutral-800 border border-neutral-600 text-white px-3 py-2 rounded text-sm focus:border-cyan-400 focus:outline-none" }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] text-neutral-500 mt-1", children: t('nameChangeHint') })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "description" }), (0, jsx_runtime_1.jsx)("textarea", { value: editFormData.description, onChange: (e) => setEditFormData({ ...editFormData, description: e.target.value }), rows: 3, className: "w-full bg-neutral-800 border border-neutral-600 text-white px-3 py-2 rounded text-sm focus:border-cyan-400 focus:outline-none resize-none" })] })] })] }), (0, jsx_runtime_1.jsx)("input", { ref: fileInputRef, type: "file", accept: "image/png,image/jpeg,image/webp", onChange: handleFileSelect, className: "hidden" }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-3 p-3 rounded bg-neutral-800/50 border border-neutral-700", children: (() => {
|
|
338
|
+
const mgr = getManagerDisplay(editingUnit);
|
|
339
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(hover_avatar_1.HoverAvatar, { src: mgr.avatar, fallback: mgr.title, size: 32, fallbackClassName: "bg-cyan-400/20 text-cyan-400" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 min-w-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-sm text-white truncate", children: mgr.title }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: mgr.subtitle })] })] }));
|
|
340
|
+
})() })] })), (0, jsx_runtime_1.jsxs)(dialog_1.DialogFooter, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { variant: "outline", size: "sm", className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", onClick: () => { setIsEditDialogOpen(false); setEditingUnit(null); setImageFile(null); setImagePreview(null); }, disabled: submitting || uploadingImage, children: t('cancel') }), (0, jsx_runtime_1.jsx)(button_1.Button, { size: "sm", onClick: handleEdit, disabled: submitting || uploadingImage, className: "bg-cyan-700 hover:bg-cyan-600 text-white", children: (submitting || uploadingImage) ? t('saving') : t('save') })] })] }) })] }));
|
|
341
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface MemberRank {
|
|
2
|
+
rank: number;
|
|
3
|
+
user_id: string;
|
|
4
|
+
nickname: string;
|
|
5
|
+
contribution: number;
|
|
6
|
+
email?: string;
|
|
7
|
+
}
|
|
8
|
+
interface StationMemberRankingProps {
|
|
9
|
+
stationId: string;
|
|
10
|
+
members?: MemberRank[];
|
|
11
|
+
}
|
|
12
|
+
export default function StationMemberRanking({ stationId, members }: StationMemberRankingProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
'use client';
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.default = StationMemberRanking;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const card_1 = require("../ui/card");
|
|
9
|
+
const badge_1 = require("../ui/badge");
|
|
10
|
+
const avatar_1 = require("../ui/avatar");
|
|
11
|
+
const lucide_react_1 = require("lucide-react");
|
|
12
|
+
const api_service_1 = require("../../lib/api-service");
|
|
13
|
+
const getRankIcon = (rank) => {
|
|
14
|
+
switch (rank) {
|
|
15
|
+
case 1: return (0, jsx_runtime_1.jsx)(lucide_react_1.Trophy, { className: "w-5 h-5 text-cyan-400" });
|
|
16
|
+
case 2: return (0, jsx_runtime_1.jsx)(lucide_react_1.Medal, { className: "w-5 h-5 text-neutral-400" });
|
|
17
|
+
case 3: return (0, jsx_runtime_1.jsx)(lucide_react_1.Award, { className: "w-5 h-5 text-cyan-300" });
|
|
18
|
+
default: return null;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const getRankBadgeColor = (rank) => {
|
|
22
|
+
switch (rank) {
|
|
23
|
+
case 1: return 'bg-cyan-400/20 text-cyan-400';
|
|
24
|
+
case 2: return 'bg-white/20 text-white';
|
|
25
|
+
case 3: return 'bg-cyan-400/20 text-cyan-300';
|
|
26
|
+
default: return 'bg-neutral-500/20 text-neutral-300';
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
function StationMemberRanking({ stationId, members }) {
|
|
30
|
+
const [data, setData] = (0, react_1.useState)([]);
|
|
31
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
32
|
+
(0, react_1.useEffect)(() => {
|
|
33
|
+
if (members) {
|
|
34
|
+
setData(members);
|
|
35
|
+
setLoading(false);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
loadMemberRanking();
|
|
39
|
+
}
|
|
40
|
+
}, [stationId, members]);
|
|
41
|
+
const loadMemberRanking = async () => {
|
|
42
|
+
try {
|
|
43
|
+
setLoading(true);
|
|
44
|
+
const response = await (0, api_service_1.getUnitMemberRanking)(stationId, 10);
|
|
45
|
+
if (response.success && response.data) {
|
|
46
|
+
setData(response.data.data);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
setData([]);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
console.error('加载成员排名失败:', error);
|
|
54
|
+
setData([]);
|
|
55
|
+
}
|
|
56
|
+
finally {
|
|
57
|
+
setLoading(false);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
if (loading) {
|
|
61
|
+
return ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "pt-6", children: (0, jsx_runtime_1.jsx)("div", { className: "h-64 flex items-center justify-center", children: (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500", children: "\u52A0\u8F7D\u4E2D..." }) }) }) }));
|
|
62
|
+
}
|
|
63
|
+
return ((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.jsx)(card_1.CardHeader, { className: "pb-2", 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.Trophy, { className: "w-5 h-5 text-cyan-400" }), "\u6210\u5458\u8D21\u732E\u6392\u884C"] }) }), (0, jsx_runtime_1.jsx)(card_1.CardContent, { children: (0, jsx_runtime_1.jsx)("div", { className: "space-y-3", children: data.map((member) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 p-2 bg-neutral-800 rounded hover:bg-neutral-700 transition-colors", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-8 flex justify-center", children: getRankIcon(member.rank) || ((0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-500 font-mono text-sm", children: ["#", member.rank] })) }), (0, jsx_runtime_1.jsx)(avatar_1.Avatar, { className: "h-8 w-8", children: (0, jsx_runtime_1.jsx)(avatar_1.AvatarFallback, { className: "bg-neutral-700 text-white text-xs", children: member.nickname.slice(0, 2).toUpperCase() }) }), (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: "text-white font-medium truncate", children: member.nickname }), member.rank <= 3 && ((0, jsx_runtime_1.jsxs)(badge_1.Badge, { className: getRankBadgeColor(member.rank), children: ["TOP ", member.rank] }))] }), member.email && ((0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-500", children: member.email }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-right", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-white font-mono font-medium", children: member.contribution.toLocaleString() }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 text-sm ml-1", children: "MCD" })] })] }, member.user_id))) }) })] }));
|
|
64
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface StationSummary {
|
|
2
|
+
total_stations: number;
|
|
3
|
+
total_members: number;
|
|
4
|
+
total_vault_balance: number;
|
|
5
|
+
total_vault_mcd: number;
|
|
6
|
+
avg_kpi_score?: number;
|
|
7
|
+
}
|
|
8
|
+
interface StationSummaryCardsProps {
|
|
9
|
+
summary: StationSummary | null;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export default function StationSummaryCards({ summary, loading }: StationSummaryCardsProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.default = StationSummaryCards;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const card_1 = require("../ui/card");
|
|
7
|
+
const lucide_react_1 = require("lucide-react");
|
|
8
|
+
function StationSummaryCards({ summary, loading }) {
|
|
9
|
+
const cards = [
|
|
10
|
+
{
|
|
11
|
+
title: '领地总数',
|
|
12
|
+
value: summary?.total_stations ?? 0,
|
|
13
|
+
icon: lucide_react_1.Building2,
|
|
14
|
+
format: (v) => v.toString(),
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
title: '总成员数',
|
|
18
|
+
value: summary?.total_members ?? 0,
|
|
19
|
+
icon: lucide_react_1.Users,
|
|
20
|
+
format: (v) => v.toLocaleString(),
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
title: '总金库余额',
|
|
24
|
+
value: summary?.total_vault_mcd ?? 0,
|
|
25
|
+
icon: lucide_react_1.Vault,
|
|
26
|
+
format: (v) => `${v.toLocaleString()} MCD`,
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: cards.map((card) => ((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: "pt-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 mb-2", children: [(0, jsx_runtime_1.jsx)(card.icon, { className: "w-8 h-8 text-white" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400 tracking-wider", children: card.title })] }), loading ? ((0, jsx_runtime_1.jsx)("div", { className: "h-8 bg-neutral-800 rounded animate-pulse" })) : ((0, jsx_runtime_1.jsx)("p", { className: "text-2xl font-bold text-white font-mono", children: card.format(card.value) }))] }) }, card.title))) }));
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function StationsPage(): import("react/jsx-runtime").JSX.Element;
|