@mohasinac/appkit 2.8.2 → 2.8.4
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/_internal/client/features/classified/ClassifiedDetailView.js +7 -1
- package/dist/_internal/client/features/digital-code/CodeRevealPanel.js +4 -1
- package/dist/_internal/client/features/digital-code/DigitalCodeDetailView.js +7 -1
- package/dist/_internal/client/features/layout/DashboardLayoutClient.js +3 -2
- package/dist/_internal/client/features/live/LiveItemDetailView.js +11 -2
- package/dist/_internal/client/scaffolds/AppShell.js +2 -1
- package/dist/_internal/client/scaffolds/DashboardScaffold.js +2 -1
- package/dist/_internal/server/features/checkout/actions.js +40 -39
- package/dist/_internal/shared/actions/action-registry.js +6 -0
- package/dist/_internal/shared/config/index.d.ts +1 -1
- package/dist/_internal/shared/config/schema.d.ts +0 -8
- package/dist/client-entry.d.ts +1 -1
- package/dist/client.d.ts +3 -1
- package/dist/client.js +3 -1
- package/dist/configs/next.js +12 -22
- package/dist/constants/api-endpoints.d.ts +6 -0
- package/dist/constants/api-endpoints.js +2 -0
- package/dist/features/about/components/AboutView.js +5 -2
- package/dist/features/about/components/FAQPageView.js +3 -3
- package/dist/features/about/components/FeesView.js +13 -5
- package/dist/features/about/components/HelpPageView.js +9 -5
- package/dist/features/about/components/HowAuctionsWorkView.js +9 -5
- package/dist/features/about/components/HowCheckoutWorksView.js +9 -5
- package/dist/features/about/components/HowOffersWorkView.js +10 -5
- package/dist/features/about/components/HowOrdersWorkView.js +10 -5
- package/dist/features/about/components/HowPayoutsWorkView.js +9 -5
- package/dist/features/about/components/HowPreOrdersWorkView.js +9 -5
- package/dist/features/about/components/HowReviewsWorkView.js +9 -5
- package/dist/features/about/components/PolicyPageView.js +3 -3
- package/dist/features/about/components/PublicProfileView.js +11 -4
- package/dist/features/about/components/SecurityPrivacyView.js +8 -4
- package/dist/features/about/components/ShippingPolicyView.js +3 -2
- package/dist/features/about/components/TrackOrderView.js +2 -2
- package/dist/features/about/components/UnauthorizedView.js +3 -3
- package/dist/features/account/components/AddressBook.js +1 -1
- package/dist/features/account/components/AddressForm.js +2 -2
- package/dist/features/account/components/AddressInlineSelect.d.ts +24 -0
- package/dist/features/account/components/AddressInlineSelect.js +78 -0
- package/dist/features/account/components/AddressSelectorCreate.d.ts +2 -1
- package/dist/features/account/components/AddressSelectorCreate.js +5 -32
- package/dist/features/account/components/AddressesIndexListing.js +3 -3
- package/dist/features/account/components/ChatWindow.js +2 -1
- package/dist/features/account/components/NotificationBell.js +13 -7
- package/dist/features/account/components/NotificationPreferencesPanel.js +4 -1
- package/dist/features/account/components/UserOffersPanel.js +2 -1
- package/dist/features/account/components/UserSidebar.js +11 -7
- package/dist/features/account/components/UserSupportView.js +13 -4
- package/dist/features/account/components/index.d.ts +2 -0
- package/dist/features/account/components/index.js +1 -0
- package/dist/features/addresses/repository/addresses.repository.d.ts +1 -0
- package/dist/features/addresses/repository/addresses.repository.js +13 -0
- package/dist/features/admin/components/AdminAdEditorView.js +8 -5
- package/dist/features/admin/components/AdminAddressEditorView.js +5 -5
- package/dist/features/admin/components/AdminAdsView.js +10 -7
- package/dist/features/admin/components/AdminAllEventEntriesView.js +5 -3
- package/dist/features/admin/components/AdminBidsView.js +6 -4
- package/dist/features/admin/components/AdminBlogEditorView.js +15 -9
- package/dist/features/admin/components/AdminBlogView.js +6 -4
- package/dist/features/admin/components/AdminBrandEditorView.js +10 -4
- package/dist/features/admin/components/AdminBrandsView.js +12 -10
- package/dist/features/admin/components/AdminBundleEditorView.js +4 -5
- package/dist/features/admin/components/AdminBundlesView.js +13 -11
- package/dist/features/admin/components/AdminCarouselEditorView.js +6 -3
- package/dist/features/admin/components/AdminCarouselView.js +6 -6
- package/dist/features/admin/components/AdminCartsView.js +6 -4
- package/dist/features/admin/components/AdminCatalogGuideView.js +2 -1
- package/dist/features/admin/components/AdminCategoriesView.js +12 -10
- package/dist/features/admin/components/AdminCategoryEditorView.js +11 -5
- package/dist/features/admin/components/AdminClassifiedView.js +4 -3
- package/dist/features/admin/components/AdminContactEditorView.js +8 -1
- package/dist/features/admin/components/AdminContactView.js +6 -4
- package/dist/features/admin/components/AdminCouponEditorView.js +23 -5
- package/dist/features/admin/components/AdminCouponsView.js +6 -4
- package/dist/features/admin/components/AdminDigitalCodesView.js +4 -3
- package/dist/features/admin/components/AdminEmployeeEditorView.js +7 -4
- package/dist/features/admin/components/AdminFaqEditorView.js +9 -3
- package/dist/features/admin/components/AdminFaqsView.js +9 -7
- package/dist/features/admin/components/AdminFeatureEditorView.js +7 -1
- package/dist/features/admin/components/AdminFeatureFlagsView.js +4 -1
- package/dist/features/admin/components/AdminFeaturesView.js +5 -4
- package/dist/features/admin/components/AdminFilterBar.js +4 -4
- package/dist/features/admin/components/AdminGroupedListingsView.js +66 -30
- package/dist/features/admin/components/AdminGuideHubView.js +4 -1
- package/dist/features/admin/components/AdminHistoryView.js +4 -3
- package/dist/features/admin/components/AdminLiveView.js +4 -3
- package/dist/features/admin/components/AdminMediaView.js +4 -1
- package/dist/features/admin/components/AdminNavigationView.js +7 -4
- package/dist/features/admin/components/AdminNewsletterView.js +5 -3
- package/dist/features/admin/components/AdminNotificationsView.js +8 -6
- package/dist/features/admin/components/AdminOrderEditorView.js +2 -2
- package/dist/features/admin/components/AdminOrdersView.js +6 -4
- package/dist/features/admin/components/AdminPageHeader.js +5 -2
- package/dist/features/admin/components/AdminPayoutsView.js +7 -5
- package/dist/features/admin/components/AdminPrizeDrawsView.js +11 -9
- package/dist/features/admin/components/AdminProductEditorView.js +12 -5
- package/dist/features/admin/components/AdminProductsView.js +11 -9
- package/dist/features/admin/components/AdminReturnRequestsView.js +4 -3
- package/dist/features/admin/components/AdminReviewsView.js +10 -8
- package/dist/features/admin/components/AdminScammerEditorView.js +6 -2
- package/dist/features/admin/components/AdminScammersView.js +11 -9
- package/dist/features/admin/components/AdminSectionsView.js +20 -22
- package/dist/features/admin/components/AdminSessionsManager.js +2 -1
- package/dist/features/admin/components/AdminSessionsView.js +8 -6
- package/dist/features/admin/components/AdminSidebar.js +11 -7
- package/dist/features/admin/components/AdminSiteConfigGuideView.js +2 -1
- package/dist/features/admin/components/AdminSiteSettingsView.js +5 -1
- package/dist/features/admin/components/AdminStoreAddressesView.js +4 -3
- package/dist/features/admin/components/AdminStoreEditorView.js +5 -5
- package/dist/features/admin/components/AdminStoresView.js +6 -4
- package/dist/features/admin/components/AdminSublistingCategoriesView.js +6 -5
- package/dist/features/admin/components/AdminSublistingCategoryEditorView.js +3 -3
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +10 -3
- package/dist/features/admin/components/AdminSupportTicketsView.js +11 -9
- package/dist/features/admin/components/AdminTeamView.js +6 -4
- package/dist/features/admin/components/AdminTrustGuideView.js +3 -3
- package/dist/features/admin/components/AdminUsersGuideView.js +3 -3
- package/dist/features/admin/components/AdminUsersView.js +6 -4
- package/dist/features/admin/components/AdminViewCards.js +12 -6
- package/dist/features/admin/components/AdminWishlistsView.js +4 -3
- package/dist/features/admin/components/BrandQuickCreateForm.js +2 -2
- package/dist/features/admin/components/CategoryQuickCreateForm.js +2 -2
- package/dist/features/admin/components/DashboardStats.js +9 -3
- package/dist/features/admin/components/DataListingView.js +3 -3
- package/dist/features/admin/components/DataTable.js +11 -7
- package/dist/features/admin/components/DrawerFormFooter.js +2 -2
- package/dist/features/admin/components/QuickEditMenu.js +2 -1
- package/dist/features/admin/components/analytics/AdminAnalyticsCharts.js +5 -1
- package/dist/features/admin/constants/filter-tabs.d.ts +1 -1
- package/dist/features/admin/constants/filter-tabs.js +0 -11
- package/dist/features/admin/types/index.d.ts +1 -1
- package/dist/features/auctions/actions/bid-actions.js +4 -2
- package/dist/features/auctions/components/AuctionBidsTable.js +4 -1
- package/dist/features/auctions/components/AuctionDetailPageView.js +14 -6
- package/dist/features/auctions/components/AuctionsListView.js +7 -6
- package/dist/features/auctions/components/CollapsibleBidHistory.js +5 -1
- package/dist/features/auctions/components/MarketplaceAuctionCard.js +9 -3
- package/dist/features/auctions/components/MarketplaceAuctionGrid.js +8 -2
- package/dist/features/auctions/components/PlaceBidFormClient.js +4 -1
- package/dist/features/auth/components/RegisterForm.js +2 -2
- package/dist/features/auth/components/VerifyEmailView.js +5 -2
- package/dist/features/before-after/components/BeforeAfterSlider.js +1 -1
- package/dist/features/blog/actions/blog-actions.js +3 -2
- package/dist/features/blog/components/BlogFeaturedCard.js +8 -1
- package/dist/features/blog/components/BlogIndexListing.js +11 -5
- package/dist/features/blog/components/BlogListView.js +11 -3
- package/dist/features/blog/components/BlogPostView.js +10 -3
- package/dist/features/cart/components/CartDrawer.js +11 -3
- package/dist/features/cart/components/CartSummary.js +2 -2
- package/dist/features/cart/components/CheckoutOtpModal.js +2 -1
- package/dist/features/categories/components/BrandDetailPageView.js +15 -10
- package/dist/features/categories/components/BrandDetailTabs.js +5 -1
- package/dist/features/categories/components/BundleDetailView.js +6 -3
- package/dist/features/categories/components/BundleDynamicRuleEditor.js +3 -1
- package/dist/features/categories/components/BundleItemsPicker.js +10 -3
- package/dist/features/categories/components/CategoriesIndexListing.js +13 -7
- package/dist/features/categories/components/CategoriesIndexPageView.js +5 -4
- package/dist/features/categories/components/CategoryBundlesListing.js +10 -6
- package/dist/features/categories/components/CategoryDetailPageView.js +18 -12
- package/dist/features/categories/components/CategoryDetailTabs.js +5 -1
- package/dist/features/categories/components/CategoryFilters.d.ts +12 -12
- package/dist/features/categories/components/CategoryFilters.js +13 -12
- package/dist/features/categories/components/CategoryForm.js +6 -3
- package/dist/features/categories/components/CategoryGrid.js +9 -2
- package/dist/features/categories/components/CategoryProductsListing.js +10 -4
- package/dist/features/categories/components/CategorySelectorCreate.js +3 -3
- package/dist/features/categories/components/CategorySortSelect.js +1 -1
- package/dist/features/categories/components/CategoryStoresListing.js +3 -3
- package/dist/features/categories/components/CategoryTableColumns.js +10 -6
- package/dist/features/categories/components/CategoryTree.d.ts +1 -1
- package/dist/features/categories/components/CategoryTree.js +2 -2
- package/dist/features/categories/schemas/firestore.d.ts +2 -2
- package/dist/features/checkout/actions/checkout-actions.d.ts +1 -1
- package/dist/features/checkout/actions/checkout-actions.js +1 -1
- package/dist/features/classified/components/ClassifiedFilters.js +2 -2
- package/dist/features/classified/components/ClassifiedIndexListing.js +9 -3
- package/dist/features/classified/components/ClassifiedListView.js +6 -5
- package/dist/features/collections/components/CollectionCard.js +2 -1
- package/dist/features/contact/components/ContactForm.js +4 -2
- package/dist/features/contact/components/ContactInfoSidebar.js +4 -1
- package/dist/features/copilot/components/AdminCopilotView.js +13 -5
- package/dist/features/cron/jobs/auction-expiry.job.d.ts +2 -2
- package/dist/features/cron/jobs/auction-expiry.job.js +2 -1
- package/dist/features/cron/jobs/preorder-reminder.job.d.ts +1 -1
- package/dist/features/cron/jobs/preorder-reminder.job.js +2 -1
- package/dist/features/digital-codes/components/DigitalCodesIndexListing.js +9 -3
- package/dist/features/digital-codes/components/DigitalCodesListView.js +4 -3
- package/dist/features/events/actions/event-actions.js +6 -4
- package/dist/features/events/components/AdminEventEditorView.js +63 -41
- package/dist/features/events/components/AdminEventEntriesView.js +9 -6
- package/dist/features/events/components/AdminEventsView.js +7 -5
- package/dist/features/events/components/EventCard.js +7 -1
- package/dist/features/events/components/EventFilters.d.ts +4 -4
- package/dist/features/events/components/EventFilters.js +2 -2
- package/dist/features/events/components/EventFormDrawer.js +2 -1
- package/dist/features/events/components/EventLeaderboard.js +4 -4
- package/dist/features/events/components/EventOfferCard.js +4 -1
- package/dist/features/events/components/EventParticipateView.js +3 -2
- package/dist/features/events/components/EventPollWidget.js +6 -5
- package/dist/features/events/components/EventRaffleEntryForm.js +5 -2
- package/dist/features/events/components/EventRaffleWinnerView.js +7 -1
- package/dist/features/events/components/EventRafflesSection.js +6 -4
- package/dist/features/events/components/EventSaleBanner.js +5 -2
- package/dist/features/events/components/EventsIndexListing.js +8 -2
- package/dist/features/events/components/EventsListView.js +4 -1
- package/dist/features/events/components/SpinWheelView.js +7 -2
- package/dist/features/events/schemas/firestore.d.ts +1 -0
- package/dist/features/events/types/index.d.ts +1 -0
- package/dist/features/faq/actions/faq-actions.js +4 -2
- package/dist/features/faq/components/ContactCTA.js +4 -1
- package/dist/features/faq/components/FAQCategorySidebar.js +2 -2
- package/dist/features/faq/components/FAQHelpfulButtons.js +8 -5
- package/dist/features/faq/components/FAQPageContent.js +7 -6
- package/dist/features/faq/components/FAQSortDropdown.js +2 -2
- package/dist/features/filters/AsyncFacetSection.js +4 -2
- package/dist/features/filters/FilterFacetSection.js +14 -6
- package/dist/features/filters/RangeFilter.js +4 -2
- package/dist/features/filters/SwitchFilter.js +2 -1
- package/dist/features/forms/Checkbox.js +1 -1
- package/dist/features/forms/Radio.js +1 -1
- package/dist/features/forms/Slider.js +1 -1
- package/dist/features/homepage/components/AdSlot.js +4 -4
- package/dist/features/homepage/components/AdvertisementBanner.js +13 -4
- package/dist/features/homepage/components/AnnouncementBar.js +2 -1
- package/dist/features/homepage/components/BeforeAfterCard.js +8 -2
- package/dist/features/homepage/components/BrandsSection.js +6 -3
- package/dist/features/homepage/components/CTABannerSection.js +2 -2
- package/dist/features/homepage/components/CharacterHotspot.js +5 -2
- package/dist/features/homepage/components/CharacterHotspotForm.js +8 -4
- package/dist/features/homepage/components/CustomCardsSection.js +13 -7
- package/dist/features/homepage/components/CustomerReviewsSection.js +9 -3
- package/dist/features/homepage/components/FAQSection.js +7 -4
- package/dist/features/homepage/components/FeaturedBundlesSection.js +8 -2
- package/dist/features/homepage/components/FeaturedResultsSection.js +1 -1
- package/dist/features/homepage/components/GoogleReviewsSection.js +14 -8
- package/dist/features/homepage/components/HeroCarousel.js +1 -1
- package/dist/features/homepage/components/HomepageSkeleton.js +7 -1
- package/dist/features/homepage/components/HowItWorksInfoView.js +2 -2
- package/dist/features/homepage/components/HowItWorksSection.js +2 -2
- package/dist/features/homepage/components/MarketplaceHomepageView.js +4 -2
- package/dist/features/homepage/components/NewsletterBanner.js +3 -2
- package/dist/features/homepage/components/NewsletterSection.js +5 -2
- package/dist/features/homepage/components/PromoGrid.js +4 -1
- package/dist/features/homepage/components/SectionCarousel.js +7 -4
- package/dist/features/homepage/components/SecurityHighlightsSection.js +3 -3
- package/dist/features/homepage/components/ShopByCategorySection.js +10 -4
- package/dist/features/homepage/components/SiteFeaturesSection.js +5 -2
- package/dist/features/homepage/components/SocialFeedSection.js +4 -4
- package/dist/features/homepage/components/SocialPostCard.js +6 -3
- package/dist/features/homepage/components/TrustFeaturesSection.js +5 -5
- package/dist/features/homepage/components/TrustIndicatorsSection.js +5 -2
- package/dist/features/homepage/components/WelcomeSection.js +1 -1
- package/dist/features/homepage/components/WhatsAppCommunitySection.js +3 -3
- package/dist/features/layout/AppLayoutShell.js +2 -1
- package/dist/features/layout/BackToTop.js +1 -1
- package/dist/features/layout/BottomActions.js +4 -30
- package/dist/features/layout/BottomActionsContext.d.ts +0 -36
- package/dist/features/layout/BottomActionsContext.js +0 -36
- package/dist/features/layout/BottomNavItem.js +1 -1
- package/dist/features/layout/BottomSheet.js +4 -1
- package/dist/features/layout/FooterLayout.js +1 -1
- package/dist/features/layout/NavbarLayout.js +4 -1
- package/dist/features/layout/SidebarLayout.js +5 -2
- package/dist/features/live/components/LiveItemFilters.js +2 -2
- package/dist/features/live/components/LiveItemsIndexListing.js +9 -3
- package/dist/features/live/components/LiveItemsListView.js +6 -5
- package/dist/features/loyalty/components/CoinsDisplay.js +4 -2
- package/dist/features/media/AvatarUpload.js +2 -2
- package/dist/features/media/MediaLightbox.js +3 -2
- package/dist/features/media/modals/VideoThumbnailSelector.js +4 -1
- package/dist/features/media/modals/VideoTrimModal.js +1 -1
- package/dist/features/media/upload/CameraCapture.js +1 -1
- package/dist/features/media/upload/ImageUpload.js +4 -1
- package/dist/features/media/upload/MediaUploadField.js +11 -2
- package/dist/features/media/upload/MediaUploadList.js +5 -1
- package/dist/features/orders/components/MarketplaceOrderCard.js +2 -2
- package/dist/features/orders/components/OrdersList.js +2 -1
- package/dist/features/orders/components/RefundHistoryTable.js +4 -1
- package/dist/features/orders/components/RefundRequestView.js +2 -1
- package/dist/features/pre-orders/components/MarketplacePreorderCard.js +5 -1
- package/dist/features/pre-orders/components/PreOrderActionsClient.js +3 -3
- package/dist/features/pre-orders/components/PreOrderBadge.js +2 -1
- package/dist/features/pre-orders/components/PreOrderDetailPageView.js +16 -7
- package/dist/features/pre-orders/components/PreOrdersIndexListing.js +32 -24
- package/dist/features/pre-orders/components/PreOrdersListView.js +5 -4
- package/dist/features/products/actions/product-actions.js +17 -15
- package/dist/features/products/columns/index.d.ts +1 -1
- package/dist/features/products/columns/index.js +1 -1
- package/dist/features/products/columns/productTableColumns.js +9 -4
- package/dist/features/products/components/AuctionsIndexListing.js +9 -3
- package/dist/features/products/components/BidHistory.js +4 -4
- package/dist/features/products/components/CompareOverlay.js +10 -2
- package/dist/features/products/components/CustomFieldsEditor.js +2 -1
- package/dist/features/products/components/CustomSectionTabContent.js +2 -2
- package/dist/features/products/components/CustomSectionsEditor.js +3 -2
- package/dist/features/products/components/GroupSettingsPanel.js +34 -26
- package/dist/features/products/components/MakeOfferButton.js +6 -2
- package/dist/features/products/components/MakeOfferForm.js +2 -1
- package/dist/features/products/components/MarketplaceBundleCard.js +6 -3
- package/dist/features/products/components/MarketplacePrizeDrawCard.js +3 -2
- package/dist/features/products/components/PlaceBidForm.js +2 -1
- package/dist/features/products/components/PrizeDrawCollage.js +6 -16
- package/dist/features/products/components/PrizeDrawDetailPageView.js +6 -1
- package/dist/features/products/components/PrizeDrawItemsEditor.js +4 -2
- package/dist/features/products/components/PrizeDrawsIndexListing.js +6 -3
- package/dist/features/products/components/PrizeDrawsListingView.js +5 -4
- package/dist/features/products/components/PrizeDrawsSection.js +6 -4
- package/dist/features/products/components/PrizeRevealModal.js +5 -1
- package/dist/features/products/components/ProductDetailPageView.js +32 -16
- package/dist/features/products/components/ProductFeatureBadges.js +9 -9
- package/dist/features/products/components/ProductForm.d.ts +11 -1
- package/dist/features/products/components/ProductForm.js +10 -5
- package/dist/features/products/components/ProductGalleryClient.js +8 -4
- package/dist/features/products/components/ProductGradingTab.js +4 -1
- package/dist/features/products/components/ProductGrid.js +35 -14
- package/dist/features/products/components/ProductInfo.js +2 -1
- package/dist/features/products/components/ProductTabs.js +2 -1
- package/dist/features/products/components/ProductTabsShell.js +5 -1
- package/dist/features/products/components/ProductsIndexListing.js +32 -24
- package/dist/features/products/components/ProductsIndexPageView.js +2 -2
- package/dist/features/products/components/RelatedProducts.js +3 -3
- package/dist/features/products/components/ShowGroupSection.js +10 -6
- package/dist/features/products/components/SublistingCarouselSection.js +7 -3
- package/dist/features/products/components/SublistingCategorySelect.d.ts +3 -1
- package/dist/features/products/components/SublistingCategorySelect.js +4 -37
- package/dist/features/products/constants/action-defs.js +3 -3
- package/dist/features/products/constants/sieve.d.ts +2 -2
- package/dist/features/products/constants/sieve.js +2 -2
- package/dist/features/products/hooks/useRelatedProducts.js +5 -4
- package/dist/features/promotions/components/CouponCard.js +5 -3
- package/dist/features/promotions/components/CouponsIndexListing.js +7 -3
- package/dist/features/promotions/repository/coupons.repository.d.ts +8 -0
- package/dist/features/promotions/repository/coupons.repository.js +2 -0
- package/dist/features/reviews/actions/review-actions.js +2 -1
- package/dist/features/reviews/components/ReviewDetailPageView.js +3 -3
- package/dist/features/reviews/components/ReviewDetailShell.js +15 -3
- package/dist/features/reviews/components/ReviewSummary.js +4 -2
- package/dist/features/reviews/components/ReviewsIndexListing.js +8 -2
- package/dist/features/reviews/components/ReviewsIndexPageView.js +7 -6
- package/dist/features/reviews/components/ReviewsList.js +1 -1
- package/dist/features/scams/actions/scam-actions.js +3 -2
- package/dist/features/scams/components/ScamAwarenessModal.js +2 -2
- package/dist/features/scams/components/ScamProfileView.js +3 -3
- package/dist/features/scams/components/ScamRegistryView.js +11 -8
- package/dist/features/search/actions/search-actions.js +7 -6
- package/dist/features/search/components/Search.js +9 -6
- package/dist/features/search/components/SearchFiltersRow.js +1 -1
- package/dist/features/search/components/SearchResultsSection.js +1 -1
- package/dist/features/seller/components/CouponInlineSelect.d.ts +22 -0
- package/dist/features/seller/components/CouponInlineSelect.js +104 -0
- package/dist/features/seller/components/GroupInlineSelect.d.ts +23 -0
- package/dist/features/seller/components/GroupInlineSelect.js +80 -0
- package/dist/features/seller/components/PhysicalLocationModal.js +2 -1
- package/dist/features/seller/components/PrintCenterView.js +2 -1
- package/dist/features/seller/components/ProductInlineSelect.d.ts +24 -0
- package/dist/features/seller/components/ProductInlineSelect.js +42 -0
- package/dist/features/seller/components/QuickProductForm.js +4 -1
- package/dist/features/seller/components/SellerAddressesView.js +8 -3
- package/dist/features/seller/components/SellerAnalyticsAlertsView.js +6 -3
- package/dist/features/seller/components/SellerAnalyticsView.js +2 -2
- package/dist/features/seller/components/SellerAuctionsView.js +7 -5
- package/dist/features/seller/components/SellerBidsView.js +12 -10
- package/dist/features/seller/components/SellerBundlesView.js +9 -7
- package/dist/features/seller/components/SellerClassifiedView.js +6 -5
- package/dist/features/seller/components/SellerCouponEditorView.d.ts +2 -0
- package/dist/features/seller/components/SellerCouponEditorView.js +15 -3
- package/dist/features/seller/components/SellerCouponsView.js +7 -5
- package/dist/features/seller/components/SellerDashboardView.js +2 -2
- package/dist/features/seller/components/SellerDigitalCodesView.js +7 -6
- package/dist/features/seller/components/SellerGoogleReviewsView.js +2 -2
- package/dist/features/seller/components/SellerGroupedListingsView.js +10 -9
- package/dist/features/seller/components/SellerLiveView.js +6 -5
- package/dist/features/seller/components/SellerOffersView.js +6 -4
- package/dist/features/seller/components/SellerOrdersView.js +18 -13
- package/dist/features/seller/components/SellerPayoutMethodsView.js +8 -6
- package/dist/features/seller/components/SellerPayoutRequestView.js +5 -1
- package/dist/features/seller/components/SellerPayoutSettingsView.js +5 -2
- package/dist/features/seller/components/SellerPayoutsView.js +6 -4
- package/dist/features/seller/components/SellerPreOrdersView.js +12 -10
- package/dist/features/seller/components/SellerPrizeDrawsView.js +12 -10
- package/dist/features/seller/components/SellerProductShell.js +1 -1
- package/dist/features/seller/components/SellerProductsCards.js +4 -1
- package/dist/features/seller/components/SellerProductsView.js +14 -12
- package/dist/features/seller/components/SellerReviewsView.js +7 -3
- package/dist/features/seller/components/SellerShippingConfigsView.js +7 -6
- package/dist/features/seller/components/SellerShippingView.js +1 -1
- package/dist/features/seller/components/SellerSidebar.js +15 -8
- package/dist/features/seller/components/SellerStoreCategoriesView.js +5 -4
- package/dist/features/seller/components/SellerStorefrontView.js +2 -2
- package/dist/features/seller/components/SellerTemplatesView.js +11 -7
- package/dist/features/seller/components/SublistingInlineSelect.d.ts +19 -0
- package/dist/features/seller/components/SublistingInlineSelect.js +84 -0
- package/dist/features/seller/components/analytics/SellerTopProducts.js +1 -1
- package/dist/features/seller/components/index.d.ts +8 -0
- package/dist/features/seller/components/index.js +4 -0
- package/dist/features/shell/FormShell.js +10 -2
- package/dist/features/shell/QuickFormDrawer.js +5 -5
- package/dist/features/shell/StepForm.js +6 -6
- package/dist/features/site-settings/components/ActionPermissionsManager.js +8 -4
- package/dist/features/site-settings/components/NavPermissionsManager.js +7 -4
- package/dist/features/stores/actions/store-query-actions.js +3 -2
- package/dist/features/stores/components/InteractiveStoreCard.js +5 -1
- package/dist/features/stores/components/StoreAboutView.js +4 -1
- package/dist/features/stores/components/StoreAddressSelectorCreate.d.ts +2 -1
- package/dist/features/stores/components/StoreAddressSelectorCreate.js +5 -31
- package/dist/features/stores/components/StoreAuctionsListing.js +6 -3
- package/dist/features/stores/components/StoreAuctionsPageView.js +4 -2
- package/dist/features/stores/components/StoreDetailLayoutView.d.ts +1 -1
- package/dist/features/stores/components/StoreDetailLayoutView.js +7 -6
- package/dist/features/stores/components/StoreGuideHubView.js +5 -2
- package/dist/features/stores/components/StoreHeader.js +8 -1
- package/dist/features/stores/components/StorePreOrdersListing.js +6 -3
- package/dist/features/stores/components/StorePreOrdersPageView.js +4 -2
- package/dist/features/stores/components/StorePrizeDrawsPageView.js +4 -2
- package/dist/features/stores/components/StoreProductsListing.js +6 -3
- package/dist/features/stores/components/StoreProductsPageView.js +2 -1
- package/dist/features/stores/components/StoreProductsView.js +5 -4
- package/dist/features/stores/components/StoreReviewsListing.js +8 -2
- package/dist/features/stores/components/StoresIndexListing.js +16 -9
- package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +7 -1
- package/dist/features/whatsapp-bot/components/WhatsAppChatButton.js +2 -1
- package/dist/features/wishlist/components/WishlistPage.js +2 -1
- package/dist/features/wishlist/components/WishlistView.js +4 -3
- package/dist/index.d.ts +10 -0
- package/dist/index.js +13 -1
- package/dist/next/components/GlobalError.js +2 -2
- package/dist/next/routing/route-map.d.ts +2 -0
- package/dist/next/routing/route-map.js +1 -0
- package/dist/react/ErrorBoundary.js +2 -2
- package/dist/styles.css +2 -1
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/DataTable.js +17 -16
- package/dist/ui/components/DateInput.js +2 -2
- package/dist/ui/components/DetailPageGallery.js +4 -1
- package/dist/ui/components/DetailPageTabs.js +6 -2
- package/dist/ui/components/ImageLightbox.js +5 -3
- package/dist/ui/components/Input.js +6 -3
- package/dist/ui/components/Layout.d.ts +4 -0
- package/dist/ui/components/Layout.js +1 -1
- package/dist/ui/components/Layout.style.css +1 -0
- package/dist/ui/components/ListingFilterDrawer.js +4 -1
- package/dist/ui/components/ListingLayout.js +9 -8
- package/dist/ui/components/ListingToolbar.js +5 -1
- package/dist/ui/components/PaginatedSelect.d.ts +1 -2
- package/dist/ui/components/PaginatedSelect.js +1 -2
- package/dist/ui/components/Radio.js +1 -1
- package/dist/ui/components/Select.js +2 -1
- package/dist/ui/components/Slider.js +1 -1
- package/dist/ui/components/VacationBanner.js +2 -1
- package/dist/ui/components/surface-tokens.d.ts +1 -0
- package/dist/ui/components/surface-tokens.js +1 -0
- package/package.json +11 -2
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
4
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
5
|
import React, { useCallback, useState } from "react";
|
|
4
6
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
5
7
|
import { Button, ConfirmDeleteModal, FilterChipGroup, ListingLayout, RowActionMenu, useToast } from "../../../ui";
|
|
@@ -55,11 +57,11 @@ export function AdminNewsletterView({ children, onBulkUnsubscribe, ...props }) {
|
|
|
55
57
|
searchPlaceholder: "Search by email or source",
|
|
56
58
|
emptyLabel: "No subscribers found",
|
|
57
59
|
filterKeys: ["status"],
|
|
58
|
-
defaultSort: "
|
|
60
|
+
defaultSort: sortBy("subscribedAt", "DESC"),
|
|
59
61
|
queryKey: ["admin", "newsletter", "listing"],
|
|
60
62
|
endpoint: ADMIN_ENDPOINTS.NEWSLETTER,
|
|
61
63
|
sortOptions: [
|
|
62
|
-
{ value: "
|
|
64
|
+
{ value: sortBy("subscribedAt", "DESC"), label: "Newest" },
|
|
63
65
|
{ value: "subscribedAt", label: "Oldest" },
|
|
64
66
|
],
|
|
65
67
|
mapRows: (response) => toRecordArray(response.subscribers).map((item, index) => ({
|
|
@@ -79,7 +81,7 @@ export function AdminNewsletterView({ children, onBulkUnsubscribe, ...props }) {
|
|
|
79
81
|
return response.meta.total;
|
|
80
82
|
return mappedRows.length;
|
|
81
83
|
},
|
|
82
|
-
buildFilters: (state) => state.status && state.status !== "All" ?
|
|
84
|
+
buildFilters: (state) => state.status && state.status !== "All" ? sieveFilter("status", SIEVE_OP.EQ, state.status) : undefined,
|
|
83
85
|
toolbarExtra: (_jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: handleExportCsv, children: ACTIONS.ADMIN["export-csv"].label })),
|
|
84
86
|
buildBulkActions: onBulkUnsubscribe
|
|
85
87
|
? (selection) => [
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
4
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
5
|
import React, { useState } from "react";
|
|
4
6
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
5
|
-
import { ConfirmDeleteModal, ListingLayout, RowActionMenu, Text, useToast } from "../../../ui";
|
|
7
|
+
import { ConfirmDeleteModal, Div, ListingLayout, RowActionMenu, Text, useToast } from "../../../ui";
|
|
6
8
|
import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
7
9
|
import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
|
|
8
10
|
import { ROW_ACTION_META, ROW_ACTION_ID } from "../../products/constants/action-defs";
|
|
@@ -50,12 +52,12 @@ export function AdminNotificationsView({ children, ...props }) {
|
|
|
50
52
|
searchPlaceholder: "Search by title or user ID",
|
|
51
53
|
emptyLabel: "No notifications found",
|
|
52
54
|
filterKeys: ["type"],
|
|
53
|
-
defaultSort: "
|
|
55
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
54
56
|
queryKey: ["admin", "notifications", "listing"],
|
|
55
57
|
endpoint: ADMIN_ENDPOINTS.ADMIN_NOTIFICATIONS,
|
|
56
58
|
sortOptions: [
|
|
57
|
-
{ value: "
|
|
58
|
-
{ value: "createdAt", label: "Oldest" },
|
|
59
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
60
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
59
61
|
],
|
|
60
62
|
mapRows: (response) => toRecordArray(response.items).map((item, index) => ({
|
|
61
63
|
id: toStringValue(item.id, `notif-${index}`),
|
|
@@ -68,7 +70,7 @@ export function AdminNotificationsView({ children, ...props }) {
|
|
|
68
70
|
type: toStringValue(item.type, ""),
|
|
69
71
|
})),
|
|
70
72
|
getTotal: (response, mappedRows) => typeof response.total === "number" ? response.total : mappedRows.length,
|
|
71
|
-
buildFilters: (state) => state.type && state.type !== "All" ?
|
|
73
|
+
buildFilters: (state) => state.type && state.type !== "All" ? sieveFilter("type", SIEVE_OP.EQ, state.type) : undefined,
|
|
72
74
|
buildBulkActions: (selection) => [
|
|
73
75
|
{
|
|
74
76
|
id: ROW_ACTION_ID.MARK_READ,
|
|
@@ -94,7 +96,7 @@ export function AdminNotificationsView({ children, ...props }) {
|
|
|
94
96
|
onClick: () => setDeleteTarget(row),
|
|
95
97
|
},
|
|
96
98
|
] })),
|
|
97
|
-
renderFilterPanel: ({ pendingFilters, setPendingFilters }) => (_jsxs(
|
|
99
|
+
renderFilterPanel: ({ pendingFilters, setPendingFilters }) => (_jsxs(Div, { className: "space-y-2", children: [_jsx(Text, { className: "text-xs font-semibold uppercase tracking-widest text-zinc-500 dark:text-zinc-400", children: "Type" }), _jsx(Div, { className: "flex flex-wrap gap-2", children: NOTIF_TYPES.map((opt) => (_jsx("button", { type: "button", onClick: () => setPendingFilters((p) => ({ ...p, type: opt === "All" ? "" : opt })), className: `rounded-full px-3 py-1 text-xs font-medium border transition-colors ${(pendingFilters.type || "All") === opt
|
|
98
100
|
? "bg-primary text-white border-primary"
|
|
99
101
|
: "border-zinc-300 dark:border-slate-600 text-zinc-700 dark:text-zinc-300 hover:bg-zinc-50 dark:hover:bg-slate-800"}`, children: opt }, opt))) })] })),
|
|
100
102
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
5
|
-
import { Button, Form, FormActions, Input, Select, SideDrawer, useToast, } from "../../../ui";
|
|
5
|
+
import { Button, Div, Form, FormActions, Input, Label, Select, SideDrawer, useToast, } from "../../../ui";
|
|
6
6
|
import { apiClient } from "../../../http";
|
|
7
7
|
import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
8
8
|
const STATUS_OPTIONS = [
|
|
@@ -70,5 +70,5 @@ export function AdminOrderEditorView({ open, onClose, orderId, orderLabel, curre
|
|
|
70
70
|
return (_jsx(SideDrawer, { isOpen: open, onClose: onClose, title: orderLabel ? `Order: ${orderLabel}` : "Update Order", children: _jsxs(Form, { onSubmit: (e) => {
|
|
71
71
|
e.preventDefault();
|
|
72
72
|
saveMutation.mutate();
|
|
73
|
-
}, className: "space-y-4 p-4", children: [_jsx(Select, { label: "Order status", options: STATUS_OPTIONS, value: status, onValueChange: setStatus }), _jsx(Input, { label: "Tracking number (optional)", value: trackingNumber, onChange: (e) => setTrackingNumber(e.target.value), placeholder: "e.g. DEL1234567890IN" }), _jsx(Select, { label: "Carrier (optional)", options: CARRIER_OPTIONS, value: carrier, onValueChange: setCarrier }), _jsxs(
|
|
73
|
+
}, className: "space-y-4 p-4", children: [_jsx(Select, { label: "Order status", options: STATUS_OPTIONS, value: status, onValueChange: setStatus }), _jsx(Input, { label: "Tracking number (optional)", value: trackingNumber, onChange: (e) => setTrackingNumber(e.target.value), placeholder: "e.g. DEL1234567890IN" }), _jsx(Select, { label: "Carrier (optional)", options: CARRIER_OPTIONS, value: carrier, onValueChange: setCarrier }), _jsxs(Div, { className: "flex flex-col gap-1", children: [_jsx(Label, { className: "text-sm font-medium text-zinc-700 dark:text-zinc-300", children: "Internal note (optional)" }), _jsx("textarea", { value: notes, onChange: (e) => setNotes(e.target.value), rows: 3, placeholder: "Reason for status change, escalation notes\u2026", className: "w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-900 dark:text-zinc-100 placeholder-zinc-400 focus:outline-none focus:ring-2 focus:ring-primary-500" })] }), (status === "refunded" || status === "return_requested") && (_jsx(Input, { label: "Refund amount \u20B9 (optional)", type: "number", min: "0", step: "0.01", value: refundAmount, onChange: (e) => setRefundAmount(e.target.value), placeholder: "e.g. 499.00" })), _jsxs(FormActions, { align: "right", children: [_jsx(Button, { type: "button", variant: "secondary", onClick: onClose, children: "Cancel" }), _jsx(Button, { type: "submit", isLoading: saveMutation.isPending, disabled: !orderId || saveMutation.isPending, children: "Save changes" })] })] }) }));
|
|
74
74
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
4
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
5
|
import React, { useState, useCallback } from "react";
|
|
4
6
|
import { FilterChipGroup, ListingLayout, useToast } from "../../../ui";
|
|
5
7
|
import { apiClient } from "../../../http";
|
|
@@ -33,12 +35,12 @@ export function AdminOrdersView({ children, ...props }) {
|
|
|
33
35
|
searchPlaceholder: "Search orders, buyers, or tracking IDs",
|
|
34
36
|
emptyLabel: "No orders found",
|
|
35
37
|
filterKeys: ["status"],
|
|
36
|
-
defaultSort: "
|
|
38
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
37
39
|
queryKey: ["admin", "orders", "listing"],
|
|
38
40
|
endpoint: ADMIN_ENDPOINTS.ORDERS,
|
|
39
41
|
sortOptions: [
|
|
40
|
-
{ value: "
|
|
41
|
-
{ value: "createdAt", label: "Oldest" },
|
|
42
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
43
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
42
44
|
],
|
|
43
45
|
mapRows: (response) => toRecordArray(response.orders).map((item, index) => ({
|
|
44
46
|
id: toStringValue(item.id, `order-${index}`),
|
|
@@ -51,7 +53,7 @@ export function AdminOrdersView({ children, ...props }) {
|
|
|
51
53
|
updatedAt: toRelativeDate(item.updatedAt ?? item.createdAt),
|
|
52
54
|
})),
|
|
53
55
|
getTotal: (response, mappedRows) => typeof response.meta?.total === "number" ? response.meta.total : mappedRows.length,
|
|
54
|
-
buildFilters: (f) => (f.status && f.status !== "All" ?
|
|
56
|
+
buildFilters: (f) => (f.status && f.status !== "All" ? sieveFilter("status", SIEVE_OP.EQ, f.status) : undefined),
|
|
55
57
|
buildBulkActions: (selection) => [
|
|
56
58
|
{
|
|
57
59
|
id: "mark-shipped",
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Heading, Nav, Text, Span, Button, Row } from "@mohasinac/appkit/ui";
|
|
2
|
+
import { Div, Heading, Nav, Text, Span, Button, Row } from "@mohasinac/appkit/ui";
|
|
3
3
|
import { ChevronRight } from "lucide-react";
|
|
4
|
+
const __P = {
|
|
5
|
+
p6: "p-6",
|
|
6
|
+
};
|
|
4
7
|
export function AdminPageHeader({ title, subtitle, description, badge, breadcrumb, actionLabel, onAction, actionIcon, actionDisabled = false, className = "", themeConfig = {
|
|
5
8
|
gradient: "bg-blue-50",
|
|
6
9
|
titleClass: "text-3xl font-bold",
|
|
7
10
|
subtitleClass: "text-lg text-gray-700",
|
|
8
11
|
spacingClass: "space-y-1",
|
|
9
12
|
}, }) {
|
|
10
|
-
return (_jsxs(
|
|
13
|
+
return (_jsxs(Div, { className: `${themeConfig.gradient} ${__P.p6} ${className}`, children: [breadcrumb && breadcrumb.length > 0 && (_jsx(Nav, { "aria-label": "Breadcrumb", className: "mb-3 flex items-center gap-1 text-sm text-zinc-500 dark:text-zinc-400", children: breadcrumb.map((crumb, index) => (_jsxs(Span, { className: "flex items-center gap-1", children: [index > 0 && _jsx(ChevronRight, { className: "w-3 h-3 flex-shrink-0" }), crumb.href && themeConfig.TextLink ? (_jsx(themeConfig.TextLink, { href: crumb.href, className: "hover:text-zinc-700 dark:hover:text-zinc-200 transition-colors", children: crumb.label })) : (_jsx(Span, { weight: "medium", className: "text-zinc-700 dark:text-zinc-200", children: crumb.label }))] }, index))) })), _jsxs(Div, { className: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4", children: [_jsxs(Div, { className: themeConfig.spacingClass, children: [_jsxs(Row, { gap: "sm", wrap: true, children: [_jsx(Heading, { level: 2, className: themeConfig.titleClass, children: title }), badge && _jsx(Span, { className: "flex-shrink-0", children: badge })] }), subtitle && (_jsx(Text, { className: themeConfig.subtitleClass, children: subtitle })), description && (_jsx(Text, { className: "text-sm text-zinc-500 dark:text-zinc-400 mt-1", children: description }))] }), actionLabel && onAction && (_jsxs(Button, { variant: "primary", onClick: onAction, disabled: actionDisabled, className: "flex-shrink-0", children: [actionIcon, actionLabel] }))] })] }));
|
|
11
14
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
4
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
5
|
import React, { useState } from "react";
|
|
4
6
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
5
7
|
import { Button, FilterChipGroup, Form, FormActions, Input, ListingLayout, Modal, RowActionMenu, useToast, } from "../../../ui";
|
|
@@ -65,13 +67,13 @@ export function AdminPayoutsView({ children, ...props }) {
|
|
|
65
67
|
searchPlaceholder: "Search stores, payout IDs, or order groups",
|
|
66
68
|
emptyLabel: "No payouts found",
|
|
67
69
|
filterKeys: ["status"],
|
|
68
|
-
defaultSort: "
|
|
70
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
69
71
|
queryKey: ["admin", "payouts", "listing"],
|
|
70
72
|
endpoint: ADMIN_ENDPOINTS.PAYOUTS,
|
|
71
73
|
sortOptions: [
|
|
72
|
-
{ value: "
|
|
73
|
-
{ value: "createdAt", label: "Oldest" },
|
|
74
|
-
{ value: "
|
|
74
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
75
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
76
|
+
{ value: sortBy("amount", "DESC"), label: "Highest amount" },
|
|
75
77
|
],
|
|
76
78
|
mapRows: (response) => toRecordArray(response.payouts).map((item, index) => ({
|
|
77
79
|
id: toStringValue(item.id, `payout-${index}`),
|
|
@@ -81,7 +83,7 @@ export function AdminPayoutsView({ children, ...props }) {
|
|
|
81
83
|
updatedAt: toRelativeDate(item.updatedAt ?? item.createdAt),
|
|
82
84
|
})),
|
|
83
85
|
getTotal: (response, mappedRows) => typeof response.meta?.total === "number" ? response.meta.total : mappedRows.length,
|
|
84
|
-
buildFilters: (state) => state.status && state.status !== "All" ?
|
|
86
|
+
buildFilters: (state) => state.status && state.status !== "All" ? sieveFilter("status", SIEVE_OP.EQ, state.status) : undefined,
|
|
85
87
|
toolbarExtra: (_jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: handleExportCsv, children: ACTIONS.ADMIN["export-csv"].label })),
|
|
86
88
|
buildBulkActions: (selection) => [
|
|
87
89
|
{
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
4
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
5
|
import React from "react";
|
|
4
6
|
import { Pencil } from "lucide-react";
|
|
5
|
-
import { Badge, Button, FilterChipGroup, ListingLayout, Text } from "../../../ui";
|
|
7
|
+
import { Badge, Button, Div, FilterChipGroup, ListingLayout, Span, Text } from "../../../ui";
|
|
6
8
|
import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
7
9
|
import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
|
|
8
10
|
import { ADMIN_PRODUCT_STATUS_TABS } from "../constants/filter-tabs";
|
|
@@ -22,13 +24,13 @@ const PRIZE_DRAW_COLUMNS = [
|
|
|
22
24
|
{
|
|
23
25
|
key: "primary",
|
|
24
26
|
header: "Prize Draw",
|
|
25
|
-
render: (row) => (_jsxs(
|
|
27
|
+
render: (row) => (_jsxs(Div, { className: "space-y-1", children: [_jsx(Text, { className: "font-semibold text-[var(--appkit-color-text)] line-clamp-1", children: row.primary }), _jsx(Text, { className: "text-xs text-[var(--appkit-color-text-muted)]", children: row.storeName })] })),
|
|
26
28
|
},
|
|
27
29
|
{
|
|
28
30
|
key: "entryFee",
|
|
29
31
|
header: "Entry Fee",
|
|
30
32
|
className: "w-28 text-right",
|
|
31
|
-
render: (row) => (_jsx(
|
|
33
|
+
render: (row) => (_jsx(Span, { size: "sm", weight: "medium", className: "text-[var(--appkit-color-text)]", children: row.entryFee })),
|
|
32
34
|
},
|
|
33
35
|
{
|
|
34
36
|
key: "status",
|
|
@@ -41,14 +43,14 @@ const PRIZE_DRAW_COLUMNS = [
|
|
|
41
43
|
key: "drawDate",
|
|
42
44
|
header: "Draw Date",
|
|
43
45
|
className: "w-32",
|
|
44
|
-
render: (row) => (_jsx(
|
|
46
|
+
render: (row) => (_jsx(Span, { size: "sm", className: "text-[var(--appkit-color-text-muted)]", children: row.drawDate })),
|
|
45
47
|
},
|
|
46
48
|
{
|
|
47
49
|
key: "updatedAt",
|
|
48
50
|
header: "Updated",
|
|
49
51
|
sortable: true,
|
|
50
52
|
className: "w-32",
|
|
51
|
-
render: (row) => (_jsx(
|
|
53
|
+
render: (row) => (_jsx(Span, { size: "sm", className: "text-[var(--appkit-color-text-muted)]", children: row.updatedAt })),
|
|
52
54
|
},
|
|
53
55
|
];
|
|
54
56
|
export function AdminPrizeDrawsView({ children, ...props }) {
|
|
@@ -61,12 +63,12 @@ export function AdminPrizeDrawsView({ children, ...props }) {
|
|
|
61
63
|
searchPlaceholder: "Search prize draws by name or store…",
|
|
62
64
|
emptyLabel: "No prize draws found",
|
|
63
65
|
filterKeys: ["status"],
|
|
64
|
-
defaultSort: "
|
|
66
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
65
67
|
queryKey: ["admin", "prize-draws", "listing"],
|
|
66
68
|
endpoint: ADMIN_ENDPOINTS.PRODUCTS,
|
|
67
69
|
sortOptions: [
|
|
68
|
-
{ value: "
|
|
69
|
-
{ value: "createdAt", label: "Oldest" },
|
|
70
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
71
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
70
72
|
{ value: "title", label: "Title A–Z" },
|
|
71
73
|
{ value: "prizeDrawEndDate", label: "Draw Date Soon" },
|
|
72
74
|
],
|
|
@@ -88,7 +90,7 @@ export function AdminPrizeDrawsView({ children, ...props }) {
|
|
|
88
90
|
}),
|
|
89
91
|
getTotal: (response, mappedRows) => typeof response.total === "number" ? response.total : mappedRows.length,
|
|
90
92
|
buildFilters: (state) => {
|
|
91
|
-
const status = state.status && state.status !== "All" ?
|
|
93
|
+
const status = state.status && state.status !== "All" ? sieveFilter("status", SIEVE_OP.EQ, state.status) : null;
|
|
92
94
|
return ["listingType==prize-draw", status].filter(Boolean).join(",");
|
|
93
95
|
},
|
|
94
96
|
getRowHref: (row) => String(ROUTES.ADMIN.PRIZE_DRAWS_EDIT(row.id)),
|
|
@@ -2,14 +2,21 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
5
|
-
import { Button, Card, CardBody, ConfirmDeleteModal, PaginatedSelect, Form, Stack, StackedViewShell, Tabs, TabsContent, TabsList, TabsTrigger, Text, useToast, } from "../../../ui";
|
|
5
|
+
import { Button, Card, CardBody, ConfirmDeleteModal, Div, PaginatedSelect, Form, Stack, StackedViewShell, Tabs, TabsContent, TabsList, TabsTrigger, Text, useToast, } from "../../../ui";
|
|
6
6
|
import { apiClient } from "../../../http";
|
|
7
7
|
import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
8
8
|
import { ProductForm } from "../../products/components/ProductForm";
|
|
9
9
|
import { normalizeListingType } from "../../products/utils/listing-type";
|
|
10
10
|
import { GroupSettingsPanel } from "../../products/components/GroupSettingsPanel";
|
|
11
|
+
import { GroupInlineSelect } from "../../seller/components/GroupInlineSelect";
|
|
11
12
|
import { CategoryQuickCreateForm } from "./CategoryQuickCreateForm";
|
|
12
13
|
import { BrandQuickCreateForm } from "./BrandQuickCreateForm";
|
|
14
|
+
const __P = {
|
|
15
|
+
p4: "p-4",
|
|
16
|
+
};
|
|
17
|
+
const __O = {
|
|
18
|
+
yAuto: "overflow-y-auto",
|
|
19
|
+
};
|
|
13
20
|
function modeFromProduct(product) {
|
|
14
21
|
const lt = normalizeListingType(product);
|
|
15
22
|
if (lt === "auction")
|
|
@@ -145,12 +152,12 @@ export function AdminProductEditorView({ productId, onSaved, onDeleted, embedded
|
|
|
145
152
|
const formContent = (_jsxs(Form, { id: "product-editor-form", onSubmit: (e) => {
|
|
146
153
|
e.preventDefault();
|
|
147
154
|
saveMutation.mutate();
|
|
148
|
-
}, className: "space-y-6", children: [_jsxs(Card, { variant: "outlined", padding: "lg", children: [_jsx(Text, { className: "text-xs font-semibold uppercase tracking-widest text-zinc-500 dark:text-zinc-400 mb-4", children: "Listing Type" }), _jsxs(Tabs, { value: mode, onChange: handleModeChange, children: [_jsxs(TabsList, { children: [(!enabledListingTypes || enabledListingTypes.includes("standard")) && (_jsx(TabsTrigger, { value: "standard", children: "Standard" })), (!enabledListingTypes || enabledListingTypes.includes("auction")) && (_jsx(TabsTrigger, { value: "auction", children: "Auction" })), (!enabledListingTypes || enabledListingTypes.includes("pre-order")) && (_jsx(TabsTrigger, { value: "preorder", children: "Pre-order" }))] }), _jsx(TabsContent, { value: "standard" }), _jsx(TabsContent, { value: "auction" }), _jsx(TabsContent, { value: "preorder" })] })] }), _jsxs(Card, { variant: "outlined", padding: "lg", children: [_jsx(Text, { className: "text-xs font-semibold uppercase tracking-widest text-zinc-500 dark:text-zinc-400 mb-4", children: "Classification" }), _jsxs(
|
|
155
|
+
}, className: "space-y-6", children: [_jsxs(Card, { variant: "outlined", padding: "lg", children: [_jsx(Text, { className: "text-xs font-semibold uppercase tracking-widest text-zinc-500 dark:text-zinc-400 mb-4", children: "Listing Type" }), _jsxs(Tabs, { value: mode, onChange: handleModeChange, children: [_jsxs(TabsList, { children: [(!enabledListingTypes || enabledListingTypes.includes("standard")) && (_jsx(TabsTrigger, { value: "standard", children: "Standard" })), (!enabledListingTypes || enabledListingTypes.includes("auction")) && (_jsx(TabsTrigger, { value: "auction", children: "Auction" })), (!enabledListingTypes || enabledListingTypes.includes("pre-order")) && (_jsx(TabsTrigger, { value: "preorder", children: "Pre-order" }))] }), _jsx(TabsContent, { value: "standard" }), _jsx(TabsContent, { value: "auction" }), _jsx(TabsContent, { value: "preorder" })] })] }), _jsxs(Card, { variant: "outlined", padding: "lg", children: [_jsx(Text, { className: "text-xs font-semibold uppercase tracking-widest text-zinc-500 dark:text-zinc-400 mb-4", children: "Classification" }), _jsxs(Div, { className: "space-y-4", children: [_jsxs(Stack, { gap: "xs", children: [_jsx(Text, { className: "text-sm font-medium text-zinc-900 dark:text-zinc-100", children: "Store" }), _jsx(PaginatedSelect, { value: product.storeId ?? null, onChange: handleStoreSelect, loadOptions: loadStoreOptions, placeholder: "Search stores\u2026", searchPlaceholder: "Type store name\u2026", noResultsText: "No stores found", ariaLabel: "Store" })] }), _jsx(ProductForm, { product: product, onChange: setProduct, renderGroupSettings: isEdit && productId
|
|
149
156
|
? (p) => (_jsx(GroupSettingsPanel, { productId: productId, productSlug: p.slug ?? productId, groupId: p.groupId, isGroupParent: p.isGroupParent, groupParentSlug: p.groupParentSlug, groupChildSlugs: p.groupChildSlugs, groupTitle: p.groupTitle, isAuction: modeFromProduct(p) === "auction", storeProductsEndpoint: "/api/admin/products", onGroupChanged: () => productQuery.refetch() }))
|
|
150
|
-
: undefined, renderCategorySelector: ({ label, value, onChange, disabled }) => (_jsxs(Stack, { gap: "xs", children: [_jsx(Text, { className: "text-sm font-medium text-zinc-900 dark:text-zinc-100", children: label }), _jsx(PaginatedSelect, { value: value || null, onChange: (v) => onChange(v ?? ""), loadOptions: loadCategoryOptions, placeholder: "Search categories\u2026", searchPlaceholder: "Type category name\u2026", noResultsText: "No categories found", ariaLabel: label, disabled: disabled, createLabel: "Category", renderCreateForm: ({ onCreated, onCancel }) => (_jsx(CategoryQuickCreateForm, { onSaved: (id, name) => onCreated({ value: id, label: name }), onCancel: onCancel })) })] })), renderBrandSelector: (args) => (_jsxs(Stack, { gap: "xs", children: [_jsx(Text, { className: "text-sm font-medium text-zinc-900 dark:text-zinc-100", children: args.label }), _jsx(PaginatedSelect, { value: args.multi ? null : (args.value || null), onChange: (v) => args.onValueChange(v ?? ""), loadOptions: loadBrandOptions, placeholder: "Search brands\u2026", searchPlaceholder: "Type brand name\u2026", noResultsText: "No brands found", ariaLabel: args.label, disabled: args.disabled, createLabel: "Brand", renderCreateForm: ({ onCreated, onCancel }) => (_jsx(BrandQuickCreateForm, { onSaved: (id, name) => onCreated({ value: id, label: name }), onCancel: onCancel })) })] })) })] })] }), _jsxs(
|
|
157
|
+
: undefined, renderGroupJoinField: ({ label, value, onChange, disabled }) => (_jsx(GroupInlineSelect, { scope: "admin", value: value ?? "", onChange: (id) => onChange(id || undefined), disabled: disabled, label: label, placeholder: "None (standalone product)", allowCreate: false })), renderCategorySelector: ({ label, value, onChange, disabled }) => (_jsxs(Stack, { gap: "xs", children: [_jsx(Text, { className: "text-sm font-medium text-zinc-900 dark:text-zinc-100", children: label }), _jsx(PaginatedSelect, { value: value || null, onChange: (v) => onChange(v ?? ""), loadOptions: loadCategoryOptions, placeholder: "Search categories\u2026", searchPlaceholder: "Type category name\u2026", noResultsText: "No categories found", ariaLabel: label, disabled: disabled, createLabel: "Category", renderCreateForm: ({ onCreated, onCancel }) => (_jsx(CategoryQuickCreateForm, { onSaved: (id, name) => onCreated({ value: id, label: name }), onCancel: onCancel })) })] })), renderBrandSelector: (args) => (_jsxs(Stack, { gap: "xs", children: [_jsx(Text, { className: "text-sm font-medium text-zinc-900 dark:text-zinc-100", children: args.label }), _jsx(PaginatedSelect, { value: args.multi ? null : (args.value || null), onChange: (v) => args.onValueChange(v ?? ""), loadOptions: loadBrandOptions, placeholder: "Search brands\u2026", searchPlaceholder: "Type brand name\u2026", noResultsText: "No brands found", ariaLabel: args.label, disabled: args.disabled, createLabel: "Brand", renderCreateForm: ({ onCreated, onCancel }) => (_jsx(BrandQuickCreateForm, { onSaved: (id, name) => onCreated({ value: id, label: name }), onCancel: onCancel })) })] })) })] })] }), _jsxs(Div, { className: "flex gap-3 lg:hidden", children: [_jsx(Button, { type: "submit", isLoading: isSubmitting, disabled: !product.title || isSubmitting, children: isEdit ? "Save changes" : "Create product" }), isEdit && (_jsx(Button, { type: "button", variant: "danger", isLoading: deleteMutation.isPending, onClick: () => setDeleteOpen(true), children: "Delete product" }))] })] }, "product-form"));
|
|
151
158
|
if (embedded) {
|
|
152
|
-
return _jsx(
|
|
159
|
+
return _jsx(Div, { className: `${__O.yAuto} ${__P.p4}`, children: formContent });
|
|
153
160
|
}
|
|
154
|
-
const twoPanel = (_jsxs(
|
|
161
|
+
const twoPanel = (_jsxs(Div, { className: "grid gap-6 lg:grid-cols-[1fr_280px] lg:items-start", children: [_jsx(CardBody, { className: "min-w-0 space-y-6 p-0", children: formContent }), _jsx(Div, { className: "hidden lg:block lg:sticky lg:top-[var(--header-height,0px)]", children: actionSidebar })] }));
|
|
155
162
|
return (_jsxs(_Fragment, { children: [_jsx(StackedViewShell, { portal: "admin", ...rest, title: isEdit ? "Edit Product" : "Create Product", sections: [twoPanel] }), _jsx(ConfirmDeleteModal, { isOpen: deleteOpen, onClose: () => setDeleteOpen(false), onConfirm: () => deleteMutation.mutate(), isDeleting: deleteMutation.isPending, title: "Delete this product?", message: "This product will be permanently removed. This action cannot be undone.", confirmText: "Delete product", variant: "danger" })] }));
|
|
156
163
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
4
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
5
|
import React, { useState, useCallback } from "react";
|
|
4
|
-
import { ListingLayout, Text, Toggle, useToast } from "../../../ui";
|
|
6
|
+
import { Div, ListingLayout, Span, Text, Toggle, useToast } from "../../../ui";
|
|
5
7
|
import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
6
8
|
import { ADMIN_PRODUCT_STATUS_TABS, ADMIN_PRODUCT_LISTING_TYPE_TABS, } from "../constants/filter-tabs";
|
|
7
9
|
import { toRecordArray, toRelativeDate, toStringValue, } from "../hooks/useAdminListingData";
|
|
@@ -32,21 +34,21 @@ function buildBaseColumns() {
|
|
|
32
34
|
key: "primary",
|
|
33
35
|
header: "Item",
|
|
34
36
|
sortable: true,
|
|
35
|
-
render: (row) => (_jsxs(
|
|
37
|
+
render: (row) => (_jsxs(Div, { className: "space-y-1", children: [_jsx(Text, { className: "font-semibold text-zinc-900 dark:text-zinc-100", children: row.primary }), _jsx(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400", children: row.secondary })] })),
|
|
36
38
|
},
|
|
37
39
|
{
|
|
38
40
|
key: "status",
|
|
39
41
|
header: "Status",
|
|
40
42
|
sortable: true,
|
|
41
43
|
className: "w-36",
|
|
42
|
-
render: (row) => (_jsx("
|
|
44
|
+
render: (row) => (_jsx(Span, { size: "xs", weight: "medium", className: "inline-flex rounded-full bg-primary-50 px-2.5 py-1 text-primary-800 dark:bg-secondary-900/30 dark:text-secondary-300", children: row.status })),
|
|
43
45
|
},
|
|
44
46
|
{
|
|
45
47
|
key: "updatedAt",
|
|
46
48
|
header: "Updated",
|
|
47
49
|
sortable: true,
|
|
48
50
|
className: "w-36",
|
|
49
|
-
render: (row) => (_jsx(
|
|
51
|
+
render: (row) => (_jsx(Span, { size: "sm", className: "text-zinc-600 dark:text-zinc-300", children: row.updatedAt })),
|
|
50
52
|
},
|
|
51
53
|
];
|
|
52
54
|
}
|
|
@@ -99,14 +101,14 @@ export function AdminProductsView({ children, ...props }) {
|
|
|
99
101
|
searchPlaceholder: "Search products, SKUs, or seller names",
|
|
100
102
|
emptyLabel: "No products found",
|
|
101
103
|
filterKeys: ["status", "type", "showSold"],
|
|
102
|
-
defaultSort: "
|
|
104
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
103
105
|
queryKey: ["admin", "products", "listing"],
|
|
104
106
|
endpoint: ADMIN_ENDPOINTS.PRODUCTS,
|
|
105
107
|
sortOptions: [
|
|
106
|
-
{ value: "
|
|
107
|
-
{ value: "createdAt", label: "Oldest" },
|
|
108
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
109
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
108
110
|
{ value: "title", label: "Title A–Z" },
|
|
109
|
-
{ value: "
|
|
111
|
+
{ value: sortBy("price", "DESC"), label: "Highest price" },
|
|
110
112
|
],
|
|
111
113
|
columns: [...buildBaseColumns(), flagColumn],
|
|
112
114
|
mapRows: (response) => toRecordArray(response.items).map((item, index) => {
|
|
@@ -133,7 +135,7 @@ export function AdminProductsView({ children, ...props }) {
|
|
|
133
135
|
if (state.showSold !== "true")
|
|
134
136
|
parts.push("isSold==false");
|
|
135
137
|
if (state.status && state.status !== "All")
|
|
136
|
-
parts.push(
|
|
138
|
+
parts.push(sieveFilter("status", SIEVE_OP.EQ, state.status));
|
|
137
139
|
const typeFilter = TYPE_FILTER_MAP[state.type];
|
|
138
140
|
if (typeFilter)
|
|
139
141
|
parts.push(typeFilter);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
4
|
import { useState } from "react";
|
|
4
5
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
5
6
|
import { ConfirmDeleteModal, RowActionMenu, useToast } from "../../../ui";
|
|
@@ -50,12 +51,12 @@ export function AdminReturnRequestsView(_props) {
|
|
|
50
51
|
searchPlaceholder: "Search by order ID or buyer",
|
|
51
52
|
emptyLabel: "No return requests",
|
|
52
53
|
filterKeys: [],
|
|
53
|
-
defaultSort: "
|
|
54
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
54
55
|
queryKey: ["admin", "return-requests", "listing"],
|
|
55
56
|
endpoint: `${ADMIN_ENDPOINTS.ORDERS}?status=return_requested`,
|
|
56
57
|
sortOptions: [
|
|
57
|
-
{ value: "
|
|
58
|
-
{ value: "createdAt", label: "Oldest" },
|
|
58
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
59
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
59
60
|
],
|
|
60
61
|
mapRows: (response) => toRecordArray(response.items).map((item, index) => ({
|
|
61
62
|
id: toStringValue(item.id, `order-${index}`),
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
4
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
5
|
import React, { useState, useCallback } from "react";
|
|
4
6
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
5
|
-
import { Button, FilterChipGroup, ListingLayout, Modal, RowActionMenu, useToast } from "../../../ui";
|
|
7
|
+
import { Button, Div, FilterChipGroup, Label, ListingLayout, Modal, RowActionMenu, useToast } from "../../../ui";
|
|
6
8
|
import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
7
9
|
import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
|
|
8
10
|
import { ROW_ACTION_META, ROW_ACTION_ID } from "../../../features/products/constants/action-defs";
|
|
@@ -75,14 +77,14 @@ export function AdminReviewsView({ children, ...props }) {
|
|
|
75
77
|
searchPlaceholder: "Search reviews, products, or seller names",
|
|
76
78
|
emptyLabel: "No reviews found",
|
|
77
79
|
filterKeys: ["status", "rating"],
|
|
78
|
-
defaultSort: "
|
|
80
|
+
defaultSort: sortBy("publishedAt", "DESC"),
|
|
79
81
|
queryKey: ["admin", "reviews", "listing"],
|
|
80
82
|
endpoint: ADMIN_ENDPOINTS.REVIEWS,
|
|
81
83
|
sortOptions: [
|
|
82
|
-
{ value: "
|
|
84
|
+
{ value: sortBy("publishedAt", "DESC"), label: "Newest" },
|
|
83
85
|
{ value: "publishedAt", label: "Oldest" },
|
|
84
|
-
{ value: "
|
|
85
|
-
{ value: "rating", label: "Lowest rating" },
|
|
86
|
+
{ value: sortBy("rating", "DESC"), label: "Highest rating" },
|
|
87
|
+
{ value: sortBy("rating", "ASC"), label: "Lowest rating" },
|
|
86
88
|
],
|
|
87
89
|
mapRows: (response) => toRecordArray(response.items).map((item, index) => ({
|
|
88
90
|
id: toStringValue(item.id, `review-${index}`),
|
|
@@ -97,9 +99,9 @@ export function AdminReviewsView({ children, ...props }) {
|
|
|
97
99
|
buildFilters: (f) => {
|
|
98
100
|
const parts = [];
|
|
99
101
|
if (f.status && f.status !== "All")
|
|
100
|
-
parts.push(
|
|
102
|
+
parts.push(sieveFilter("status", SIEVE_OP.EQ, f.status));
|
|
101
103
|
if (f.rating && f.rating !== "All")
|
|
102
|
-
parts.push(
|
|
104
|
+
parts.push(sieveFilter("rating", SIEVE_OP.EQ, f.rating));
|
|
103
105
|
return parts.join(",") || undefined;
|
|
104
106
|
},
|
|
105
107
|
buildBulkActions: (selection) => [
|
|
@@ -151,7 +153,7 @@ export function AdminReviewsView({ children, ...props }) {
|
|
|
151
153
|
setReplyOpen(false);
|
|
152
154
|
setReplyText("");
|
|
153
155
|
setReplyTarget(null);
|
|
154
|
-
}, title: "Reply to review", children: _jsxs(
|
|
156
|
+
}, title: "Reply to review", children: _jsxs(Div, { className: "space-y-4", children: [_jsxs(Div, { className: "flex flex-col gap-1", children: [_jsx(Label, { className: "text-sm font-medium text-zinc-700 dark:text-zinc-300", children: "Admin reply" }), _jsx("textarea", { value: replyText, onChange: (e) => setReplyText(e.target.value), rows: 4, placeholder: "Write a public reply to this review\u2026", className: "w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-900 dark:text-zinc-100 placeholder-zinc-400 focus:outline-none focus:ring-2 focus:ring-primary-500" })] }), _jsxs(Div, { className: "flex justify-end gap-2", children: [_jsx(Button, { variant: "secondary", onClick: () => {
|
|
155
157
|
setReplyOpen(false);
|
|
156
158
|
setReplyText("");
|
|
157
159
|
setReplyTarget(null);
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
5
|
-
import { Button, Div, FormActions, Select, SideDrawer, Text, useToast, } from "../../../ui";
|
|
5
|
+
import { Button, Code, Div, FormActions, Label, Select, SideDrawer, Span, Text, useToast, } from "../../../ui";
|
|
6
6
|
import { apiClient } from "../../../http";
|
|
7
7
|
import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
8
|
+
const __P = {
|
|
9
|
+
p3: "p-3",
|
|
10
|
+
p4: "p-4",
|
|
11
|
+
};
|
|
8
12
|
const CLS_SECTION_LABEL = "text-xs font-medium text-zinc-500 dark:text-zinc-400 uppercase tracking-wide";
|
|
9
13
|
const STATUS_OPTIONS = [
|
|
10
14
|
{ label: "Pending review", value: "pending_review" },
|
|
@@ -58,5 +62,5 @@ export function AdminScammerEditorView({ open, onClose, scammerId, displayNames
|
|
|
58
62
|
showToast(err?.message ?? "Failed to delete profile.", "error");
|
|
59
63
|
},
|
|
60
64
|
});
|
|
61
|
-
return (_jsx(SideDrawer, { isOpen: open, onClose: onClose, title: displayNames.length > 0 ? displayNames[0] : "Scammer Profile", children: _jsxs(Div, { className:
|
|
65
|
+
return (_jsx(SideDrawer, { isOpen: open, onClose: onClose, title: displayNames.length > 0 ? displayNames[0] : "Scammer Profile", children: _jsxs(Div, { className: `flex flex-col gap-4 ${__P.p4}`, children: [_jsxs(Div, { className: "flex items-center gap-2", children: [_jsx(Span, { size: "xs", weight: "medium", className: `inline-flex rounded-full px-2.5 py-1 ${STATUS_COLOR[currentStatus ?? "pending_review"] ?? STATUS_COLOR.pending_review}`, children: (currentStatus ?? "pending_review").replace(/_/g, " ") }), scamType && (_jsx(Span, { size: "xs", className: "rounded-full bg-zinc-100 px-2.5 py-1 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300", children: scamType.replace(/_/g, " ") }))] }), displayNames.length > 0 && (_jsxs(Div, { children: [_jsx(Text, { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-zinc-500 dark:text-zinc-400", children: "Names / Aliases" }), _jsx(Div, { className: "flex flex-wrap gap-1", children: displayNames.map((name, i) => (_jsx(Span, { size: "xs", className: "rounded-full bg-zinc-100 px-2.5 py-0.5 dark:bg-zinc-800", children: name }, i))) })] })), (phones.length > 0 || upiIds.length > 0) && (_jsxs(Div, { className: `rounded-lg border border-zinc-200 bg-zinc-50 ${__P.p3} dark:border-zinc-700 dark:bg-zinc-900/40`, children: [phones.length > 0 && (_jsxs(Div, { className: "mb-2", children: [_jsx(Text, { className: CLS_SECTION_LABEL, children: "Phone numbers" }), _jsx(Div, { className: "flex flex-wrap gap-1", children: phones.map((p, i) => (_jsx(Code, { className: "rounded bg-zinc-200 px-1.5 py-0.5 text-xs dark:bg-zinc-700", children: p }, i))) })] })), upiIds.length > 0 && (_jsxs(_Fragment, { children: [_jsx(Text, { className: CLS_SECTION_LABEL, children: "UPI IDs" }), _jsx(Div, { className: "flex flex-wrap gap-1", children: upiIds.map((u, i) => (_jsx(Code, { className: "rounded bg-zinc-200 px-1.5 py-0.5 text-xs dark:bg-zinc-700", children: u }, i))) })] }))] })), description && (_jsxs(Div, { className: `rounded-lg border border-zinc-200 bg-zinc-50 ${__P.p3} dark:border-zinc-700 dark:bg-zinc-900/40`, children: [_jsx(Text, { className: CLS_SECTION_LABEL, children: "Description" }), _jsx(Text, { className: "whitespace-pre-wrap text-sm text-zinc-700 dark:text-zinc-200", children: description })] })), _jsxs(Div, { className: "text-xs text-zinc-500 dark:text-zinc-400", children: ["Reported by:", " ", _jsx(Span, { weight: "medium", className: "text-zinc-700 dark:text-zinc-300", children: reportedByAnon ? "Anonymous" : (reportedBy ?? "Unknown") })] }), _jsx("hr", { className: "border-zinc-200 dark:border-zinc-700" }), _jsx(Select, { label: "Status", options: STATUS_OPTIONS, value: status, onValueChange: setStatus }), _jsxs(Div, { className: "flex flex-col gap-1", children: [_jsx(Label, { className: "text-xs font-semibold uppercase tracking-wide text-zinc-500 dark:text-zinc-400", children: "Verification note (internal)" }), _jsx("textarea", { value: note, onChange: (e) => setNote(e.target.value), rows: 3, placeholder: "e.g. Verified via 3 independent reports\u2026", className: "w-full rounded-lg border border-zinc-300 dark:border-zinc-700 bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-900 dark:text-zinc-100 placeholder-zinc-400 focus:outline-none focus:ring-2 focus:ring-primary-500" })] }), _jsxs(FormActions, { align: "right", children: [_jsx(Button, { type: "button", variant: "danger", size: "sm", disabled: !scammerId, isLoading: deleteMutation.isPending, onClick: () => deleteMutation.mutate(), children: "Delete" }), _jsx(Button, { type: "button", variant: "secondary", onClick: onClose, children: "Cancel" }), _jsx(Button, { type: "button", isLoading: updateMutation.isPending, disabled: !scammerId || updateMutation.isPending, onClick: () => updateMutation.mutate(), children: "Save changes" })] })] }) }));
|
|
62
66
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
|
|
4
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
3
5
|
import React, { useState } from "react";
|
|
4
|
-
import { FilterChipGroup, ListingLayout, RowActionMenu, Text } from "../../../ui";
|
|
6
|
+
import { Div, FilterChipGroup, ListingLayout, RowActionMenu, Span, Text } from "../../../ui";
|
|
5
7
|
import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
6
8
|
import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
|
|
7
9
|
import { ADMIN_SCAMMER_STATUS_TABS } from "../constants/filter-tabs";
|
|
@@ -18,7 +20,7 @@ const SCAMMER_COLUMNS = [
|
|
|
18
20
|
{
|
|
19
21
|
key: "primary",
|
|
20
22
|
header: "Name / Aliases",
|
|
21
|
-
render: (row) => (_jsxs(
|
|
23
|
+
render: (row) => (_jsxs(Div, { className: "space-y-0.5", children: [_jsx(Text, { className: "font-medium text-zinc-900 dark:text-zinc-100", children: row.primary }), row.secondary ? (_jsx(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400", children: row.secondary })) : null] })),
|
|
22
24
|
},
|
|
23
25
|
{
|
|
24
26
|
key: "status",
|
|
@@ -30,7 +32,7 @@ const SCAMMER_COLUMNS = [
|
|
|
30
32
|
key: "updatedAt",
|
|
31
33
|
header: "Updated",
|
|
32
34
|
className: "w-32",
|
|
33
|
-
render: (row) => (_jsx(
|
|
35
|
+
render: (row) => (_jsx(Span, { size: "sm", className: "text-zinc-500 dark:text-zinc-400", children: row.updatedAt })),
|
|
34
36
|
},
|
|
35
37
|
];
|
|
36
38
|
export function AdminScammersView({ children, ...props }) {
|
|
@@ -45,14 +47,14 @@ export function AdminScammersView({ children, ...props }) {
|
|
|
45
47
|
searchPlaceholder: "Search by name, phone, UPI ID",
|
|
46
48
|
emptyLabel: "No scammer profiles found",
|
|
47
49
|
filterKeys: ["status"],
|
|
48
|
-
defaultSort: "
|
|
50
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
49
51
|
queryKey: ["admin", "scammers", "listing"],
|
|
50
52
|
endpoint: ADMIN_ENDPOINTS.SCAMMERS,
|
|
51
53
|
sortOptions: [
|
|
52
|
-
{ value: "
|
|
53
|
-
{ value: "createdAt", label: "Oldest" },
|
|
54
|
-
{ value: "
|
|
55
|
-
{ value: "
|
|
54
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
55
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
56
|
+
{ value: sortBy("views", "DESC"), label: "Most viewed" },
|
|
57
|
+
{ value: sortBy("incidentCount", "DESC"), label: "Most incidents" },
|
|
56
58
|
],
|
|
57
59
|
columns: SCAMMER_COLUMNS,
|
|
58
60
|
mapRows: (response) => toRecordArray(response.scammers).map((item, index) => ({
|
|
@@ -80,7 +82,7 @@ export function AdminScammersView({ children, ...props }) {
|
|
|
80
82
|
return response.total;
|
|
81
83
|
return mappedRows.length;
|
|
82
84
|
},
|
|
83
|
-
buildFilters: (f) => (f.status && f.status !== "All" ?
|
|
85
|
+
buildFilters: (f) => (f.status && f.status !== "All" ? sieveFilter("status", SIEVE_OP.EQ, f.status) : undefined),
|
|
84
86
|
renderRowActions: (row) => (_jsx(RowActionMenu, { actions: [
|
|
85
87
|
{
|
|
86
88
|
label: ACTIONS.ADMIN["review-scammer"].label,
|