@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,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
'use client';
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.default = StationsPage;
|
|
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 button_1 = require("../ui/button");
|
|
11
|
+
const time_remaining_1 = require("../ui/time-remaining");
|
|
12
|
+
const input_1 = require("../ui/input");
|
|
13
|
+
const label_1 = require("../ui/label");
|
|
14
|
+
const dialog_1 = require("../ui/dialog");
|
|
15
|
+
const sonner_1 = require("sonner");
|
|
16
|
+
const useAuth_1 = require("../../hooks/useAuth");
|
|
17
|
+
const api_service_1 = require("../../lib/api-service");
|
|
18
|
+
const utils_1 = require("../../lib/utils");
|
|
19
|
+
const lucide_react_1 = require("lucide-react");
|
|
20
|
+
const getUnitTypeIcon = (type) => {
|
|
21
|
+
switch (type) {
|
|
22
|
+
case 'station': return (0, jsx_runtime_1.jsx)(lucide_react_1.Building2, { className: "w-5 h-5" });
|
|
23
|
+
case 'matrix': return (0, jsx_runtime_1.jsx)(lucide_react_1.Grid3x3, { className: "w-5 h-5" });
|
|
24
|
+
case 'sector': return (0, jsx_runtime_1.jsx)(lucide_react_1.Map, { className: "w-5 h-5" });
|
|
25
|
+
case 'system': return (0, jsx_runtime_1.jsx)(lucide_react_1.Globe, { className: "w-5 h-5" });
|
|
26
|
+
default: return (0, jsx_runtime_1.jsx)(lucide_react_1.Building2, { className: "w-5 h-5" });
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const getUnitTypeLabel = (type) => {
|
|
30
|
+
switch (type) {
|
|
31
|
+
case 'station': return '空间站';
|
|
32
|
+
case 'matrix': return '矩阵';
|
|
33
|
+
case 'sector': return '星区';
|
|
34
|
+
case 'system': return '星系';
|
|
35
|
+
default: return type;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const getUnitTypeColor = (type) => {
|
|
39
|
+
switch (type) {
|
|
40
|
+
case 'station': return 'text-white';
|
|
41
|
+
case 'matrix': return 'text-cyan-300';
|
|
42
|
+
case 'sector': return 'text-cyan-200';
|
|
43
|
+
case 'system': return 'text-cyan-400';
|
|
44
|
+
default: return 'text-white';
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const getTechBonusPercentage = (type) => {
|
|
48
|
+
switch (type) {
|
|
49
|
+
case 'station': return 10;
|
|
50
|
+
case 'matrix': return 20;
|
|
51
|
+
case 'sector': return 30;
|
|
52
|
+
case 'system': return 40;
|
|
53
|
+
default: return 0;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const distributionPlans = [
|
|
57
|
+
{ id: 'equal', name: '平等分配', description: '所有成员平均分配利润' },
|
|
58
|
+
{ id: 'weighted_rank', name: '等级加权', description: '根据用户等级加权分配' },
|
|
59
|
+
{ id: 'weighted_contribution', name: '贡献加权', description: '根据交易量贡献加权分配' },
|
|
60
|
+
{ id: 'hybrid', name: '混合模式', description: '等级50% + 贡献50%' },
|
|
61
|
+
{ id: 'manager_bonus', name: '管理员奖励', description: '管理员额外10%奖励' },
|
|
62
|
+
];
|
|
63
|
+
function StationsPage() {
|
|
64
|
+
const { isAdmin } = (0, useAuth_1.useAuth)();
|
|
65
|
+
const [units, setUnits] = (0, react_1.useState)([]);
|
|
66
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
67
|
+
const [refreshing, setRefreshing] = (0, react_1.useState)(false);
|
|
68
|
+
const [filter, setFilter] = (0, react_1.useState)('all');
|
|
69
|
+
const [searchTerm, setSearchTerm] = (0, react_1.useState)('');
|
|
70
|
+
const [unitDetailsCache, setUnitDetailsCache] = (0, react_1.useState)({});
|
|
71
|
+
const [isKPIDialogOpen, setIsKPIDialogOpen] = (0, react_1.useState)(false);
|
|
72
|
+
const [isDistributionDialogOpen, setIsDistributionDialogOpen] = (0, react_1.useState)(false);
|
|
73
|
+
const [isNameEditDialogOpen, setIsNameEditDialogOpen] = (0, react_1.useState)(false);
|
|
74
|
+
const [selectedUnit, setSelectedUnit] = (0, react_1.useState)(null);
|
|
75
|
+
const [nameStatus, setNameStatus] = (0, react_1.useState)(null);
|
|
76
|
+
const [newName, setNewName] = (0, react_1.useState)('');
|
|
77
|
+
const [nameLoading, setNameLoading] = (0, react_1.useState)(false);
|
|
78
|
+
const [selectedDistributionPlan, setSelectedDistributionPlan] = (0, react_1.useState)('');
|
|
79
|
+
const [submitting, setSubmitting] = (0, react_1.useState)(false);
|
|
80
|
+
(0, react_1.useEffect)(() => { loadUnits(); }, [filter]);
|
|
81
|
+
const loadUnits = async () => {
|
|
82
|
+
try {
|
|
83
|
+
setLoading(true);
|
|
84
|
+
const filterParam = filter === 'all' ? undefined : filter;
|
|
85
|
+
const response = await (0, api_service_1.getUnits)(filterParam);
|
|
86
|
+
if (response.success && response.data) {
|
|
87
|
+
setUnits(response.data);
|
|
88
|
+
for (const unit of response.data) {
|
|
89
|
+
loadStationData(unit.unit_id);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
sonner_1.toast.error('加载领地列表失败');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
sonner_1.toast.error(error instanceof Error ? error.message : '加载领地列表失败');
|
|
98
|
+
}
|
|
99
|
+
finally {
|
|
100
|
+
setLoading(false);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const loadStationData = async (unitId) => {
|
|
104
|
+
try {
|
|
105
|
+
const response = await (0, api_service_1.getUnitDetailedStats)(unitId);
|
|
106
|
+
if (response.success && response.data) {
|
|
107
|
+
setUnitDetailsCache(prev => ({ ...prev, [unitId]: response.data }));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
console.error(`加载领地 ${unitId} 数据失败:`, error);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const handleRefresh = async () => {
|
|
115
|
+
setRefreshing(true);
|
|
116
|
+
await loadUnits();
|
|
117
|
+
setRefreshing(false);
|
|
118
|
+
sonner_1.toast.success('数据已刷新');
|
|
119
|
+
};
|
|
120
|
+
const filteredUnits = units.filter(unit => {
|
|
121
|
+
const matchesSearch = unit.unit_name.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
|
122
|
+
(unit.location?.toLowerCase().includes(searchTerm.toLowerCase()));
|
|
123
|
+
return matchesSearch;
|
|
124
|
+
});
|
|
125
|
+
const handleSetDistributionPlan = async () => {
|
|
126
|
+
if (!selectedUnit || !selectedDistributionPlan)
|
|
127
|
+
return;
|
|
128
|
+
try {
|
|
129
|
+
setSubmitting(true);
|
|
130
|
+
const response = await (0, api_service_1.setUnitDistributionPlan)(selectedUnit.unit_id, parseInt(selectedDistributionPlan));
|
|
131
|
+
if (response.success) {
|
|
132
|
+
sonner_1.toast.success('分配方案设置成功');
|
|
133
|
+
setIsDistributionDialogOpen(false);
|
|
134
|
+
setSelectedDistributionPlan('');
|
|
135
|
+
setSelectedUnit(null);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
sonner_1.toast.error(response.error || '设置失败');
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
sonner_1.toast.error(error instanceof Error ? error.message : '设置失败');
|
|
143
|
+
}
|
|
144
|
+
finally {
|
|
145
|
+
setSubmitting(false);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
const openNameEditDialog = async (unit) => {
|
|
149
|
+
setSelectedUnit(unit);
|
|
150
|
+
setNewName(unit.unit_name);
|
|
151
|
+
setIsNameEditDialogOpen(true);
|
|
152
|
+
setNameLoading(true);
|
|
153
|
+
try {
|
|
154
|
+
const response = await (0, api_service_1.getTerritoryNameStatus)(unit.unit_id);
|
|
155
|
+
if (response.success && response.data) {
|
|
156
|
+
setNameStatus(response.data);
|
|
157
|
+
setNewName(response.data.current_name);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
sonner_1.toast.error(response.error || '获取名称状态失败');
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
sonner_1.toast.error(error instanceof Error ? error.message : '获取名称状态失败');
|
|
165
|
+
}
|
|
166
|
+
finally {
|
|
167
|
+
setNameLoading(false);
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
const handleNameUpdate = async () => {
|
|
171
|
+
if (!selectedUnit || !newName.trim()) {
|
|
172
|
+
sonner_1.toast.error('请输入新的领地名称');
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (newName.trim().length < 2) {
|
|
176
|
+
sonner_1.toast.error('领地名称至少需要2个字符');
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
try {
|
|
180
|
+
setSubmitting(true);
|
|
181
|
+
const response = await (0, api_service_1.updateTerritoryName)(selectedUnit.unit_id, newName.trim());
|
|
182
|
+
if (response.success) {
|
|
183
|
+
sonner_1.toast.success(response.message || '领地名称更新成功');
|
|
184
|
+
setIsNameEditDialogOpen(false);
|
|
185
|
+
setSelectedUnit(null);
|
|
186
|
+
setNameStatus(null);
|
|
187
|
+
setNewName('');
|
|
188
|
+
loadUnits();
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
if (response.error?.includes('90天') || response.error?.includes('cooldown')) {
|
|
192
|
+
sonner_1.toast.error(`修改冷却中:${response.error}`);
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
sonner_1.toast.error(response.error || '更新失败');
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
sonner_1.toast.error(error instanceof Error ? error.message : '更新失败');
|
|
201
|
+
}
|
|
202
|
+
finally {
|
|
203
|
+
setSubmitting(false);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
if (loading) {
|
|
207
|
+
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: "\u9886\u5730\u7BA1\u7406" }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400 mt-1", children: "\u7BA1\u7406\u9886\u5730NFT\u3001\u67E5\u770BKPI\u548C\u91D1\u5E93\u4F59\u989D" })] }), (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: "\u6B63\u5728\u52A0\u8F7D\u9886\u5730\u6570\u636E..." })] })] }));
|
|
208
|
+
}
|
|
209
|
+
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: "\u9886\u5730\u7BA1\u7406" }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400 mt-1", children: "\u7BA1\u7406\u9886\u5730NFT\u3001\u67E5\u770BKPI\u548C\u91D1\u5E93\u4F59\u989D" })] }), (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", onClick: handleRefresh, disabled: refreshing, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: (0, utils_1.cn)("w-4 h-4 mr-2", refreshing && "animate-spin") }), "\u5237\u65B0"] })] }), (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 gap-2 text-xs text-neutral-400 tracking-wider mb-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Zap, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { children: "\u9886\u5730\u5347\u7EA7\u8981\u6C42" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-3 bg-neutral-800 rounded", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 mb-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Users, { className: "w-5 h-5 text-white" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400 tracking-wider", children: "member_count" })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-white font-mono", children: "900" }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500 mt-1", children: "\u6700\u4F4E\u8981\u6C42\u6210\u5458\u6570" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-3 bg-neutral-800 rounded", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 mb-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.DollarSign, { className: "w-5 h-5 text-white" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400 tracking-wider", children: "trading_volume" })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-white font-mono", children: "50M" }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500 mt-1", children: "\u6700\u4F4E\u7D2F\u8BA1\u4EA4\u6613\u91CF USDT" })] })] })] }) }), (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 gap-2 text-xs text-neutral-400 tracking-wider mb-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Zap, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { children: "\u4E0D\u540C\u5C42\u7EA7\u9886\u5730\u7684 MCC \u94F8\u9020\u52A0\u6210" })] }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3", children: ['station', 'matrix', 'sector', 'system'].map((type) => ((0, jsx_runtime_1.jsxs)("div", { className: "p-3 bg-neutral-800 rounded text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("mx-auto mb-2", getUnitTypeColor(type)), children: getUnitTypeIcon(type) }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: getUnitTypeLabel(type) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-2xl font-bold text-white font-mono", children: ["+", getTechBonusPercentage(type), "%"] })] }, type))) })] }) }), (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-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1", children: (0, jsx_runtime_1.jsx)(input_1.Input, { placeholder: "\u641C\u7D22\u9886\u5730\u540D\u79F0\u6216\u4F4D\u7F6E...", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), className: "bg-neutral-800 border-neutral-600 text-white placeholder-neutral-400 h-9" }) }), (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: (0, utils_1.cn)(filter === f
|
|
210
|
+
? "bg-cyan-700 hover:bg-cyan-600 text-white border-cyan-700"
|
|
211
|
+
: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent"), children: f === 'all' ? '全部' : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [f === 'station' && (0, jsx_runtime_1.jsx)(lucide_react_1.Building2, { className: "w-3.5 h-3.5 mr-1" }), f === 'matrix' && (0, jsx_runtime_1.jsx)(lucide_react_1.Grid3x3, { className: "w-3.5 h-3.5 mr-1" }), f === 'sector' && (0, jsx_runtime_1.jsx)(lucide_react_1.Map, { className: "w-3.5 h-3.5 mr-1" }), f === 'system' && (0, jsx_runtime_1.jsx)(lucide_react_1.Globe, { className: "w-3.5 h-3.5 mr-1" }), getUnitTypeLabel(f)] })) }, f))) })] }) }) }), filteredUnits.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-12 text-neutral-500 text-sm", children: "\u6682\u65E0\u9886\u5730\u6570\u636E" })) : ((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) => {
|
|
212
|
+
const unitDetails = unitDetailsCache[unit.unit_id];
|
|
213
|
+
const memberCount = unitDetails?.metrics.member_count ?? 0;
|
|
214
|
+
const maxCapacity = unitDetails?.metrics.max_capacity ?? 1000;
|
|
215
|
+
const vaultMcd = unitDetails?.metrics.vault_mcd ?? 0;
|
|
216
|
+
const occupancyRate = unitDetails?.metrics.occupancy_rate ?? 0;
|
|
217
|
+
const isActive = occupancyRate >= 50;
|
|
218
|
+
const techBonusPercent = getTechBonusPercentage(unit.unit_type);
|
|
219
|
+
return ((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-start justify-between mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("p-2 rounded bg-neutral-800", getUnitTypeColor(unit.unit_type)), children: getUnitTypeIcon(unit.unit_type) }), (0, jsx_runtime_1.jsxs)("div", { 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", children: unit.unit_name }), (0, jsx_runtime_1.jsx)("button", { onClick: (e) => { e.stopPropagation(); openNameEditDialog(unit); }, className: "p-1 text-neutral-500 hover:text-cyan-400 rounded transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Pencil, { className: "w-3.5 h-3.5" }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider", children: getUnitTypeLabel(unit.unit_type) })] })] }), (0, jsx_runtime_1.jsx)(badge_1.Badge, { className: isActive ? "bg-white/20 text-white" : "bg-neutral-500/20 text-neutral-300", children: isActive ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "w-3 h-3 mr-1" }), "\u6D3B\u8DC3"] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.XCircle, { className: "w-3 h-3 mr-1" }), "\u5F85\u53D1\u5C55"] })) })] }), (0, jsx_runtime_1.jsx)("div", { className: "p-3 bg-neutral-800 rounded mb-3", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-xs text-neutral-400 tracking-wider", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Zap, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { children: "tech_bonus" })] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-lg font-bold text-white font-mono", children: ["+", techBonusPercent, "%"] })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "p-3 bg-neutral-800 rounded mb-3", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-xs text-neutral-400 tracking-wider", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Vault, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { children: "vault_mcd" })] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-lg font-bold text-white font-mono", children: [vaultMcd.toLocaleString(), " MCD"] })] }) }), unitDetails && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-3 mb-3", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between text-xs text-neutral-400 mb-1", children: [(0, jsx_runtime_1.jsx)("span", { children: "\u6210\u5458\u6570\u91CF" }), (0, jsx_runtime_1.jsxs)("span", { className: "font-mono", children: [memberCount, " / ", maxCapacity] })] }), (0, jsx_runtime_1.jsx)("div", { className: "w-full bg-neutral-800 rounded-full h-2 overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-cyan-400 h-2 rounded-full transition-all", style: { width: `${Math.min((memberCount / maxCapacity) * 100, 100)}%` } }) })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between text-xs text-neutral-400 mb-1", children: [(0, jsx_runtime_1.jsx)("span", { children: "\u5165\u9A7B\u7387" }), (0, jsx_runtime_1.jsxs)("span", { className: "font-mono", children: [occupancyRate.toFixed(1), "%"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "w-full bg-neutral-800 rounded-full h-2 overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-cyan-400 h-2 rounded-full transition-all", style: { width: `${Math.min(occupancyRate, 100)}%` } }) })] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-1.5 text-xs border-t border-neutral-700 pt-3 mb-3", children: [unit.location && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center text-neutral-400", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.MapPin, { className: "w-3.5 h-3.5 mr-2" }), unit.location] })), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center text-neutral-400", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Calendar, { className: "w-3.5 h-3.5 mr-2" }), "\u521B\u5EFA\u4E8E ", (0, jsx_runtime_1.jsx)(time_remaining_1.FormattedDate, { dateTime: unit.created_at })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center text-neutral-400", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Users, { className: "w-3.5 h-3.5 mr-2" }), "\u5BB9\u91CF: ", (0, jsx_runtime_1.jsx)("span", { className: "font-mono", children: unit.capacity || 1000 })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-2 pt-3 border-t border-neutral-700", children: [(0, jsx_runtime_1.jsxs)(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: () => { setSelectedUnit(unit); setIsKPIDialogOpen(true); }, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.TrendingUp, { className: "w-3.5 h-3.5 mr-1" }), "KPI\u8BE6\u60C5"] }), (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", onClick: () => { setSelectedUnit(unit); setIsDistributionDialogOpen(true); }, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Settings, { className: "w-3.5 h-3.5 mr-1" }), "\u5206\u914D\u65B9\u6848"] })] })] }) }, unit.unit_id));
|
|
220
|
+
}) })), (0, jsx_runtime_1.jsx)(dialog_1.Dialog, { open: isKPIDialogOpen, onOpenChange: setIsKPIDialogOpen, children: (0, jsx_runtime_1.jsxs)(dialog_1.DialogContent, { className: "bg-neutral-900 border-neutral-700", children: [(0, jsx_runtime_1.jsxs)(dialog_1.DialogHeader, { children: [(0, jsx_runtime_1.jsxs)(dialog_1.DialogTitle, { className: "text-white tracking-wider", children: [selectedUnit?.unit_id.slice(0, 8), " KPI"] }), (0, jsx_runtime_1.jsxs)(dialog_1.DialogDescription, { className: "text-neutral-400", children: [selectedUnit?.unit_name, " - ", getUnitTypeLabel(selectedUnit?.unit_type || 'station')] })] }), selectedUnit && unitDetailsCache[selectedUnit.unit_id] && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4 py-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-3 bg-neutral-800 rounded", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400 tracking-wider", children: "member_count" }), unitDetailsCache[selectedUnit.unit_id].metrics.occupancy_rate >= 50 ? ((0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "w-5 h-5 text-white" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.XCircle, { className: "w-5 h-5 text-neutral-500" }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-baseline gap-2 mb-3", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-2xl font-bold text-white font-mono", children: unitDetailsCache[selectedUnit.unit_id].metrics.member_count }), (0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-500 font-mono", children: ["/ ", unitDetailsCache[selectedUnit.unit_id].metrics.max_capacity] })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between text-xs text-neutral-400 mb-1", children: [(0, jsx_runtime_1.jsx)("span", { children: "\u5165\u9A7B\u7387" }), (0, jsx_runtime_1.jsxs)("span", { className: "font-mono", children: [unitDetailsCache[selectedUnit.unit_id].metrics.occupancy_rate.toFixed(1), "%"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "w-full bg-neutral-800 rounded-full h-2 overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-cyan-400 h-2 rounded-full transition-all", style: { width: `${Math.min(unitDetailsCache[selectedUnit.unit_id].metrics.occupancy_rate, 100)}%` } }) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-3 bg-neutral-800 rounded", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-2", children: "vault_mcd" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-baseline gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-2xl font-bold text-white font-mono", children: (unitDetailsCache[selectedUnit.unit_id].metrics.vault_mcd ?? 0).toLocaleString() }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500", children: "MCD" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-3 bg-neutral-800 rounded", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-2", children: "status" }), unitDetailsCache[selectedUnit.unit_id].metrics.occupancy_rate >= 50 ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-white", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "w-5 h-5" }), (0, jsx_runtime_1.jsx)("span", { children: "\u6D3B\u8DC3\u72B6\u6001\uFF0C\u6301\u7EED\u53D1\u5C55\u4E2D" })] })) : ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-500", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.XCircle, { className: "w-5 h-5" }), (0, jsx_runtime_1.jsx)("span", { children: "\u5F85\u53D1\u5C55\uFF0C\u9080\u8BF7\u66F4\u591A\u6210\u5458\u52A0\u5165" })] }))] })] })), (0, jsx_runtime_1.jsx)(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: () => setIsKPIDialogOpen(false), children: "\u5173\u95ED" }) })] }) }), (0, jsx_runtime_1.jsx)(dialog_1.Dialog, { open: isDistributionDialogOpen, onOpenChange: setIsDistributionDialogOpen, children: (0, jsx_runtime_1.jsxs)(dialog_1.DialogContent, { className: "bg-neutral-900 border-neutral-700", children: [(0, jsx_runtime_1.jsxs)(dialog_1.DialogHeader, { children: [(0, jsx_runtime_1.jsx)(dialog_1.DialogTitle, { className: "text-white tracking-wider", children: "distribution_plan" }), (0, jsx_runtime_1.jsx)(dialog_1.DialogDescription, { className: "text-neutral-400", children: "\u9009\u62E9\u5229\u6DA6\u5206\u914D\u65B9\u5F0F" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-4 py-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-2", children: "distribution_plan" }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-2", children: distributionPlans.map((plan) => ((0, jsx_runtime_1.jsx)("div", { onClick: () => setSelectedDistributionPlan(plan.id), className: (0, utils_1.cn)("p-4 rounded border cursor-pointer transition-colors", selectedDistributionPlan === plan.id
|
|
221
|
+
? "bg-neutral-800 border-cyan-400/50"
|
|
222
|
+
: "bg-neutral-900 border-neutral-700 hover:border-neutral-600"), children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "font-medium text-white mb-1", children: plan.name }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm text-neutral-400", children: plan.description })] }), selectedDistributionPlan === plan.id && ((0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "w-5 h-5 text-cyan-400" }))] }) }, plan.id))) })] }), (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: () => { setIsDistributionDialogOpen(false); setSelectedDistributionPlan(''); setSelectedUnit(null); }, disabled: submitting, children: "\u53D6\u6D88" }), (0, jsx_runtime_1.jsx)(button_1.Button, { size: "sm", onClick: handleSetDistributionPlan, disabled: submitting || !selectedDistributionPlan, className: "bg-cyan-700 hover:bg-cyan-600 text-white", children: submitting ? '设置中...' : '确认设置' })] })] }) }), (0, jsx_runtime_1.jsx)(dialog_1.Dialog, { open: isNameEditDialogOpen, onOpenChange: (open) => {
|
|
223
|
+
setIsNameEditDialogOpen(open);
|
|
224
|
+
if (!open) {
|
|
225
|
+
setSelectedUnit(null);
|
|
226
|
+
setNameStatus(null);
|
|
227
|
+
setNewName('');
|
|
228
|
+
}
|
|
229
|
+
}, children: (0, jsx_runtime_1.jsxs)(dialog_1.DialogContent, { className: "bg-neutral-900 border-neutral-700", children: [(0, jsx_runtime_1.jsxs)(dialog_1.DialogHeader, { children: [(0, jsx_runtime_1.jsxs)(dialog_1.DialogTitle, { className: "text-white tracking-wider", children: ["rename_territory ", selectedUnit?.unit_id?.toString().slice(0, 8)] }), (0, jsx_runtime_1.jsx)(dialog_1.DialogDescription, { className: "text-neutral-400", children: "\u4FEE\u6539\u9886\u5730\u540D\u79F0\uFF08\u6BCF90\u5929\u53EF\u4FEE\u6539\u4E00\u6B21\uFF09" })] }), nameLoading ? ((0, jsx_runtime_1.jsxs)("div", { className: "py-8 text-center text-neutral-400", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-6 h-6 animate-spin mx-auto mb-2" }), "\u52A0\u8F7D\u4E2D..."] })) : nameStatus ? ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4 py-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-3 bg-neutral-800 rounded", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-2", children: "current_name" }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg text-white font-medium", children: nameStatus.current_name })] }), !nameStatus.can_modify && ((0, jsx_runtime_1.jsx)("div", { className: "p-3 bg-neutral-800 rounded border border-neutral-700", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-3", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Clock, { className: "w-5 h-5 text-cyan-400 mt-0.5" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-medium", children: "\u4FEE\u6539\u51B7\u5374\u4E2D" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-sm text-neutral-400 mt-1", children: ["\u8FD8\u9700\u7B49\u5F85 ", (0, jsx_runtime_1.jsx)("span", { className: "font-bold font-mono", children: nameStatus.remaining_days }), " \u5929", nameStatus.next_modify_date && ((0, jsx_runtime_1.jsxs)("span", { className: "ml-1", children: ["\uFF08", nameStatus.next_modify_date, " \u53EF\u4FEE\u6539\uFF09"] }))] })] })] }) })), nameStatus.is_team_managed && ((0, jsx_runtime_1.jsx)("div", { className: "p-3 bg-neutral-800 rounded border border-neutral-700", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-3", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-5 h-5 text-cyan-400 mt-0.5" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-medium", children: "\u56E2\u961F\u4EE3\u7BA1\u9886\u5730" }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm text-neutral-400 mt-1", children: "\u9886\u5730\u5F53\u524D\u7531\u56E2\u961F\u4EE3\u7BA1\uFF0C\u4EFB\u4F55\u5DF2\u767B\u5F55\u7528\u6237\u90FD\u53EF\u4EE5\u4FEE\u6539\u540D\u79F0" })] })] }) })), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(label_1.Label, { className: "text-xs text-neutral-400 tracking-wider", children: "new_name *" }), (0, jsx_runtime_1.jsx)(input_1.Input, { value: newName, onChange: (e) => setNewName(e.target.value), placeholder: "\u8F93\u5165\u65B0\u7684\u9886\u5730\u540D\u79F0", className: "bg-neutral-800 border-neutral-600 text-white placeholder-neutral-400 mt-1", maxLength: 50, disabled: !nameStatus.can_modify && !isAdmin() }), (0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-500 mt-1 font-mono", children: [newName.length, "/50 \u5B57\u7B26\uFF08\u81F3\u5C112\u4E2A\u5B57\u7B26\uFF09"] })] }), nameStatus.last_modified_at && ((0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-500 border-t border-neutral-700 pt-3", children: [(0, jsx_runtime_1.jsxs)("div", { children: ["\u4E0A\u6B21\u4FEE\u6539: ", nameStatus.last_modified_at] }), nameStatus.last_modified_by && ((0, jsx_runtime_1.jsxs)("div", { children: ["\u4FEE\u6539\u4EBA: ", (0, jsx_runtime_1.jsxs)("span", { className: "font-mono", children: [nameStatus.last_modified_by.slice(0, 8), "..."] })] }))] }))] })) : ((0, jsx_runtime_1.jsx)("div", { className: "py-8 text-center text-neutral-500", children: "\u52A0\u8F7D\u540D\u79F0\u72B6\u6001\u5931\u8D25" })), (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: () => {
|
|
230
|
+
setIsNameEditDialogOpen(false);
|
|
231
|
+
setSelectedUnit(null);
|
|
232
|
+
setNameStatus(null);
|
|
233
|
+
setNewName('');
|
|
234
|
+
}, disabled: submitting, children: "\u53D6\u6D88" }), (0, jsx_runtime_1.jsx)(button_1.Button, { size: "sm", onClick: handleNameUpdate, disabled: submitting ||
|
|
235
|
+
!newName.trim() ||
|
|
236
|
+
newName.trim().length < 2 ||
|
|
237
|
+
newName === nameStatus?.current_name ||
|
|
238
|
+
(!nameStatus?.can_modify && !isAdmin()), className: "bg-cyan-700 hover:bg-cyan-600 text-white", children: submitting ? '更新中...' : '确认修改' })] })] }) })] }));
|
|
239
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function TerritoryNFTBrowser(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
'use client';
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.default = TerritoryNFTBrowser;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const useAuth_1 = require("../../hooks/useAuth");
|
|
9
|
+
const card_1 = require("../ui/card");
|
|
10
|
+
const badge_1 = require("../ui/badge");
|
|
11
|
+
const button_1 = require("../ui/button");
|
|
12
|
+
const tabs_1 = require("../ui/tabs");
|
|
13
|
+
const skeleton_1 = require("../ui/skeleton");
|
|
14
|
+
const input_1 = require("../ui/input");
|
|
15
|
+
const dialog_1 = require("../ui/dialog");
|
|
16
|
+
const lucide_react_1 = require("lucide-react");
|
|
17
|
+
const sonner_1 = require("sonner");
|
|
18
|
+
const services_1 = require("../../lib/api/services");
|
|
19
|
+
const next_intl_1 = require("next-intl");
|
|
20
|
+
const getNftTypeIcon = (type) => {
|
|
21
|
+
switch (type?.toLowerCase()) {
|
|
22
|
+
case 'station': return (0, jsx_runtime_1.jsx)(lucide_react_1.Building2, { className: "w-5 h-5" });
|
|
23
|
+
case 'matrix': return (0, jsx_runtime_1.jsx)(lucide_react_1.Grid3x3, { className: "w-5 h-5" });
|
|
24
|
+
case 'sector': return (0, jsx_runtime_1.jsx)(lucide_react_1.Map, { className: "w-5 h-5" });
|
|
25
|
+
case 'system': return (0, jsx_runtime_1.jsx)(lucide_react_1.Globe, { className: "w-5 h-5" });
|
|
26
|
+
default: return (0, jsx_runtime_1.jsx)(lucide_react_1.Image, { className: "w-5 h-5" });
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const getNftTypeColor = (type) => {
|
|
30
|
+
switch (type?.toLowerCase()) {
|
|
31
|
+
case 'station': return 'bg-neutral-500/20 text-neutral-400 border-neutral-500/30';
|
|
32
|
+
case 'matrix': return 'bg-cyan-400/20 text-cyan-300 border-cyan-400/30';
|
|
33
|
+
case 'sector': return 'bg-cyan-400/10 text-cyan-200 border-cyan-300/30';
|
|
34
|
+
case 'system': return 'bg-cyan-400/20 text-cyan-400 border-cyan-400/30';
|
|
35
|
+
default: return 'bg-neutral-500/20 text-neutral-400 border-neutral-500/30';
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
function truncateAddress(address, start = 4, end = 4) {
|
|
39
|
+
if (!address)
|
|
40
|
+
return '';
|
|
41
|
+
if (address.length <= start + end)
|
|
42
|
+
return address;
|
|
43
|
+
return `${address.slice(0, start)}...${address.slice(-end)}`;
|
|
44
|
+
}
|
|
45
|
+
function NFTCard({ nft, onClick, getNftTypeLabel }) {
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 cursor-pointer dash-card", onClick: onClick, children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "aspect-square bg-neutral-800 rounded-lg mb-3 flex items-center justify-center overflow-hidden", children: nft.image ? ((0, jsx_runtime_1.jsx)("img", { src: nft.image, alt: nft.name, className: "w-full h-full object-cover" })) : ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center justify-center text-neutral-600", children: [getNftTypeIcon(nft.nft_type), (0, jsx_runtime_1.jsx)("span", { className: "text-xs mt-1", children: "No Image" })] })) }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("h3", { className: "font-semibold text-white truncate", children: nft.name }), (0, jsx_runtime_1.jsx)(badge_1.Badge, { className: getNftTypeColor(nft.nft_type), children: getNftTypeLabel(nft.nft_type) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2 text-xs text-neutral-500", children: (0, jsx_runtime_1.jsxs)("span", { className: "truncate", children: ["Unit: ", nft.unit_id] }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2 text-xs text-neutral-500", children: (0, jsx_runtime_1.jsx)("span", { className: "truncate font-mono", children: truncateAddress(nft.mint, 8, 8) }) })] })] }) }));
|
|
47
|
+
}
|
|
48
|
+
function TerritoryNFTBrowser() {
|
|
49
|
+
const t = (0, next_intl_1.useTranslations)('territoryDash');
|
|
50
|
+
const { user } = (0, useAuth_1.useAuth)();
|
|
51
|
+
const [collection, setCollection] = (0, react_1.useState)(null);
|
|
52
|
+
const [myNfts, setMyNfts] = (0, react_1.useState)([]);
|
|
53
|
+
const [searchResults, setSearchResults] = (0, react_1.useState)([]);
|
|
54
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
55
|
+
const [searching, setSearching] = (0, react_1.useState)(false);
|
|
56
|
+
const [refreshing, setRefreshing] = (0, react_1.useState)(false);
|
|
57
|
+
const [searchQuery, setSearchQuery] = (0, react_1.useState)('');
|
|
58
|
+
const [selectedNft, setSelectedNft] = (0, react_1.useState)(null);
|
|
59
|
+
const [showNftDetail, setShowNftDetail] = (0, react_1.useState)(false);
|
|
60
|
+
const [copiedAddress, setCopiedAddress] = (0, react_1.useState)(null);
|
|
61
|
+
const getNftTypeLabel = (type) => {
|
|
62
|
+
switch (type?.toLowerCase()) {
|
|
63
|
+
case 'station': return t('station');
|
|
64
|
+
case 'matrix': return t('matrix');
|
|
65
|
+
case 'sector': return t('sector');
|
|
66
|
+
case 'system': return t('system');
|
|
67
|
+
default: return type;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
(0, react_1.useEffect)(() => {
|
|
71
|
+
loadData();
|
|
72
|
+
}, [user]);
|
|
73
|
+
const loadData = async () => {
|
|
74
|
+
try {
|
|
75
|
+
setLoading(true);
|
|
76
|
+
const [collectionRes, myNftsRes] = await Promise.all([
|
|
77
|
+
(0, services_1.getTerritoryNftCollection)(),
|
|
78
|
+
user ? (0, services_1.getUserTerritoryNfts)() : Promise.resolve({ success: true, data: [] })
|
|
79
|
+
]);
|
|
80
|
+
if (collectionRes.success && collectionRes.data) {
|
|
81
|
+
setCollection(collectionRes.data);
|
|
82
|
+
}
|
|
83
|
+
if (myNftsRes.success && myNftsRes.data) {
|
|
84
|
+
const nftsData = myNftsRes.data;
|
|
85
|
+
if (Array.isArray(nftsData)) {
|
|
86
|
+
setMyNfts(nftsData);
|
|
87
|
+
}
|
|
88
|
+
else if (nftsData.nfts && Array.isArray(nftsData.nfts)) {
|
|
89
|
+
setMyNfts(nftsData.nfts);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
setMyNfts([]);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
console.error('Failed to load data:', error);
|
|
98
|
+
sonner_1.toast.error(t('loadFailed'));
|
|
99
|
+
}
|
|
100
|
+
finally {
|
|
101
|
+
setLoading(false);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const handleRefresh = async () => {
|
|
105
|
+
setRefreshing(true);
|
|
106
|
+
await loadData();
|
|
107
|
+
setRefreshing(false);
|
|
108
|
+
sonner_1.toast.success(t('refreshed'));
|
|
109
|
+
};
|
|
110
|
+
const handleSearch = async () => {
|
|
111
|
+
if (!searchQuery.trim())
|
|
112
|
+
return;
|
|
113
|
+
try {
|
|
114
|
+
setSearching(true);
|
|
115
|
+
const result = await (0, services_1.getTerritoryNftMetadata)(searchQuery.trim());
|
|
116
|
+
if (result.success && result.data) {
|
|
117
|
+
setSearchResults([result.data]);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
setSearchResults([]);
|
|
121
|
+
sonner_1.toast.info(t('nftNotFound'));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
console.error('Search failed:', error);
|
|
126
|
+
sonner_1.toast.error(t('searchFailed'));
|
|
127
|
+
setSearchResults([]);
|
|
128
|
+
}
|
|
129
|
+
finally {
|
|
130
|
+
setSearching(false);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
const copyAddress = (address) => {
|
|
134
|
+
navigator.clipboard.writeText(address);
|
|
135
|
+
setCopiedAddress(address);
|
|
136
|
+
setTimeout(() => setCopiedAddress(null), 2000);
|
|
137
|
+
sonner_1.toast.success(t('addressCopied'));
|
|
138
|
+
};
|
|
139
|
+
const openNftDetail = (nft) => {
|
|
140
|
+
setSelectedNft(nft);
|
|
141
|
+
setShowNftDetail(true);
|
|
142
|
+
};
|
|
143
|
+
if (loading) {
|
|
144
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { className: "h-8 w-48" }), (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { className: "h-10 w-24" })] }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4", children: [...Array(4)].map((_, i) => ((0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { className: "h-32 rounded-lg" }, i))) }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: [...Array(6)].map((_, i) => ((0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { className: "h-64 rounded-lg" }, i))) })] }));
|
|
145
|
+
}
|
|
146
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-2xl font-bold text-white", children: t('title') }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 text-sm mt-1", children: t('subtitle') })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", onClick: handleRefresh, disabled: refreshing, className: "border-neutral-700 text-neutral-300", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: `w-4 h-4 mr-2 ${refreshing ? 'animate-spin' : ''}` }), t('refresh')] })] }), collection && ((0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4", 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-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Building2, { className: "w-4 h-4 text-neutral-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm text-neutral-400", children: t('station') })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-2xl font-bold text-white font-mono", children: collection.station_count })] }) }), (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-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Grid3x3, { className: "w-4 h-4 text-cyan-300" }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm text-neutral-400", children: t('matrix') })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-2xl font-bold text-white font-mono", children: collection.matrix_count })] }) }), (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-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Map, { className: "w-4 h-4 text-cyan-300" }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm text-neutral-400", children: t('sector') })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-2xl font-bold text-white font-mono", children: collection.sector_count })] }) }), (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-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Image, { className: "w-4 h-4 text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-sm text-neutral-400", children: t('totalMinted') })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-2xl font-bold text-white font-mono", children: collection.total_minted })] }) })] })), (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-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)(input_1.Input, { placeholder: t('searchPlaceholder'), value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), onKeyDown: (e) => e.key === 'Enter' && handleSearch(), className: "bg-neutral-800 border-neutral-700 text-white" }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleSearch, disabled: searching || !searchQuery.trim(), className: "bg-neutral-800 hover:bg-neutral-700 text-white", children: searching ? ((0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: "w-4 h-4 animate-spin" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.Search, { className: "w-4 h-4" })) })] }), searchResults.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "mt-4", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-sm text-neutral-400 mb-2", children: t('searchResults') }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: searchResults.map((nft) => ((0, jsx_runtime_1.jsx)(NFTCard, { nft: nft, onClick: () => openNftDetail(nft), getNftTypeLabel: getNftTypeLabel }, nft.mint))) })] }))] }) }), (0, jsx_runtime_1.jsxs)(tabs_1.Tabs, { defaultValue: "my-nfts", className: "w-full", children: [(0, jsx_runtime_1.jsxs)(tabs_1.TabsList, { className: "bg-neutral-900 border-neutral-700", children: [(0, jsx_runtime_1.jsx)(tabs_1.TabsTrigger, { value: "my-nfts", children: t('myNfts', { count: myNfts.length }) }), (0, jsx_runtime_1.jsx)(tabs_1.TabsTrigger, { value: "all", children: t('allNfts') })] }), (0, jsx_runtime_1.jsx)(tabs_1.TabsContent, { value: "my-nfts", className: "mt-4", children: myNfts.length === 0 ? ((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.Image, { className: "w-12 h-12 mx-auto mb-4 text-neutral-600" }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400", children: t('noNfts') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-500 mt-1", children: t('noNftsHint') })] }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4", children: myNfts.map((nft) => ((0, jsx_runtime_1.jsx)(NFTCard, { nft: nft, onClick: () => openNftDetail(nft), getNftTypeLabel: getNftTypeLabel }, nft.mint))) })) }), (0, jsx_runtime_1.jsx)(tabs_1.TabsContent, { value: "all", className: "mt-4", 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.Search, { className: "w-12 h-12 mx-auto mb-4 text-neutral-600" }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400", children: t('useSearch') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-neutral-500 mt-1", children: t('useSearchHint') })] }) }) })] }), (0, jsx_runtime_1.jsx)(dialog_1.Dialog, { open: showNftDetail, onOpenChange: setShowNftDetail, 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", children: selectedNft?.name }), (0, jsx_runtime_1.jsx)(dialog_1.DialogDescription, { className: "text-neutral-400", children: t('nftDetails') })] }), selectedNft && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "aspect-square bg-neutral-800 rounded-lg flex items-center justify-center overflow-hidden", children: selectedNft.image ? ((0, jsx_runtime_1.jsx)("img", { src: selectedNft.image, alt: selectedNft.name, className: "w-full h-full object-cover" })) : ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center justify-center text-neutral-600", children: [getNftTypeIcon(selectedNft.nft_type), (0, jsx_runtime_1.jsx)("span", { className: "text-sm mt-2", children: "No Image" })] })) }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-sm", children: t('type') }), (0, jsx_runtime_1.jsx)(badge_1.Badge, { className: getNftTypeColor(selectedNft.nft_type), children: getNftTypeLabel(selectedNft.nft_type) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-sm", children: t('unitId') }), (0, jsx_runtime_1.jsx)("span", { className: "text-white font-mono text-sm", children: selectedNft.unit_id })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-sm", children: "Symbol" }), (0, jsx_runtime_1.jsx)("span", { className: "text-white font-mono text-sm", children: selectedNft.symbol })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-sm", children: t('mintAddress') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-white font-mono text-xs", children: truncateAddress(selectedNft.mint, 8, 8) }), (0, jsx_runtime_1.jsx)("button", { onClick: () => copyAddress(selectedNft.mint), className: "text-neutral-400 hover:text-white", children: copiedAddress === selectedNft.mint ? ((0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle, { className: "w-4 h-4 text-white" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "w-4 h-4" })) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-sm", children: t('owner') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-white font-mono text-xs", children: truncateAddress(selectedNft.owner, 8, 8) }), (0, jsx_runtime_1.jsx)("button", { onClick: () => copyAddress(selectedNft.owner), className: "text-neutral-400 hover:text-white", children: copiedAddress === selectedNft.owner ? ((0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle, { className: "w-4 h-4 text-white" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "w-4 h-4" })) })] })] }), selectedNft.created_at && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-sm", children: t('createdAt') }), (0, jsx_runtime_1.jsx)("span", { className: "text-white text-sm", children: new Date(selectedNft.created_at * 1000).toLocaleString() })] }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2 pt-2", children: [(0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", className: "flex-1 border-neutral-700 text-neutral-300", onClick: () => window.open(`https://solscan.io/account/${selectedNft.mint}`, '_blank'), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ExternalLink, { className: "w-4 h-4 mr-2" }), "Solana Explorer"] }), selectedNft.uri && ((0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", className: "flex-1 border-neutral-700 text-neutral-300", onClick: () => window.open(selectedNft.uri, '_blank'), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ExternalLink, { className: "w-4 h-4 mr-2" }), "Metadata"] }))] })] }))] }) })] }));
|
|
147
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
+
declare function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,57 @@
|
|
|
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.Accordion = Accordion;
|
|
39
|
+
exports.AccordionItem = AccordionItem;
|
|
40
|
+
exports.AccordionTrigger = AccordionTrigger;
|
|
41
|
+
exports.AccordionContent = AccordionContent;
|
|
42
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
43
|
+
const AccordionPrimitive = __importStar(require("@radix-ui/react-accordion"));
|
|
44
|
+
const lucide_react_1 = require("lucide-react");
|
|
45
|
+
const utils_1 = require("../../lib/utils");
|
|
46
|
+
function Accordion({ ...props }) {
|
|
47
|
+
return (0, jsx_runtime_1.jsx)(AccordionPrimitive.Root, { "data-slot": "accordion", ...props });
|
|
48
|
+
}
|
|
49
|
+
function AccordionItem({ className, ...props }) {
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(AccordionPrimitive.Item, { "data-slot": "accordion-item", className: (0, utils_1.cn)("border-b last:border-b-0", className), ...props }));
|
|
51
|
+
}
|
|
52
|
+
function AccordionTrigger({ className, children, ...props }) {
|
|
53
|
+
return ((0, jsx_runtime_1.jsx)(AccordionPrimitive.Header, { className: "flex", children: (0, jsx_runtime_1.jsxs)(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: (0, utils_1.cn)("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180", className), ...props, children: [children, (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })] }) }));
|
|
54
|
+
}
|
|
55
|
+
function AccordionContent({ className, children, ...props }) {
|
|
56
|
+
return ((0, jsx_runtime_1.jsx)(AccordionPrimitive.Content, { "data-slot": "accordion-content", className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm", ...props, children: (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("pt-0 pb-4", className), children: children }) }));
|
|
57
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
3
|
+
declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function AlertDialogContent({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function AlertDialogCancel({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|