@mohasinac/appkit 2.7.59 → 2.8.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.
Files changed (324) hide show
  1. package/dist/_internal/client/features/filters/filter-load-options.d.ts +4 -5
  2. package/dist/_internal/server/features/auctions/og.js +8 -32
  3. package/dist/_internal/server/features/blog/og.js +10 -49
  4. package/dist/_internal/server/features/checkout/actions.js +6 -0
  5. package/dist/_internal/server/features/classified/og.js +9 -51
  6. package/dist/_internal/server/features/digital-code/actions.d.ts +11 -0
  7. package/dist/_internal/server/features/digital-code/actions.js +30 -0
  8. package/dist/_internal/server/features/digital-code/index.d.ts +1 -0
  9. package/dist/_internal/server/features/digital-code/index.js +1 -0
  10. package/dist/_internal/server/features/digital-code/og.js +9 -51
  11. package/dist/_internal/server/features/events/og.js +10 -49
  12. package/dist/_internal/server/features/item-requests/data.d.ts +17 -0
  13. package/dist/_internal/server/features/item-requests/data.js +20 -0
  14. package/dist/_internal/server/features/item-requests/index.d.ts +2 -0
  15. package/dist/_internal/server/features/item-requests/index.js +2 -0
  16. package/dist/_internal/server/features/item-requests/og.d.ts +40 -0
  17. package/dist/_internal/server/features/item-requests/og.js +136 -0
  18. package/dist/_internal/server/features/live/actions.d.ts +5 -0
  19. package/dist/_internal/server/features/live/actions.js +24 -0
  20. package/dist/_internal/server/features/live/index.d.ts +1 -0
  21. package/dist/_internal/server/features/live/index.js +1 -0
  22. package/dist/_internal/server/features/live/og.js +9 -51
  23. package/dist/_internal/server/features/media/contextGuards.js +19 -8
  24. package/dist/_internal/server/features/pre-orders/og.js +8 -32
  25. package/dist/_internal/server/features/prize-draws/data.d.ts +17 -0
  26. package/dist/_internal/server/features/prize-draws/data.js +20 -0
  27. package/dist/_internal/server/features/prize-draws/index.d.ts +2 -0
  28. package/dist/_internal/server/features/prize-draws/index.js +2 -0
  29. package/dist/_internal/server/features/prize-draws/og.d.ts +30 -0
  30. package/dist/_internal/server/features/prize-draws/og.js +50 -0
  31. package/dist/_internal/server/features/products/og.js +8 -33
  32. package/dist/_internal/server/features/seo/og-layout.d.ts +42 -0
  33. package/dist/_internal/server/features/seo/og-layout.js +69 -0
  34. package/dist/_internal/server/features/stores/og.js +8 -41
  35. package/dist/_internal/server/features/sublisting-categories/og.js +11 -42
  36. package/dist/client.d.ts +10 -6
  37. package/dist/client.js +7 -3
  38. package/dist/constants/index.d.ts +4 -0
  39. package/dist/constants/index.js +2 -0
  40. package/dist/constants/notification-types.d.ts +20 -0
  41. package/dist/constants/notification-types.js +37 -0
  42. package/dist/constants/pagination-presets.d.ts +39 -0
  43. package/dist/constants/pagination-presets.js +38 -0
  44. package/dist/errors/messages.d.ts +0 -4
  45. package/dist/errors/messages.js +0 -4
  46. package/dist/features/about/components/PublicProfileView.js +8 -8
  47. package/dist/features/account/components/UserOffersPanel.js +1 -1
  48. package/dist/features/account/components/UserSupportView.d.ts +1 -2
  49. package/dist/features/account/components/UserSupportView.js +9 -1
  50. package/dist/features/admin/actions/admin-actions.js +16 -1
  51. package/dist/features/admin/components/AdminAllEventEntriesView.d.ts +2 -3
  52. package/dist/features/admin/components/AdminAllEventEntriesView.js +50 -83
  53. package/dist/features/admin/components/AdminBidsView.d.ts +2 -3
  54. package/dist/features/admin/components/AdminBidsView.js +64 -98
  55. package/dist/features/admin/components/AdminBlogView.d.ts +3 -7
  56. package/dist/features/admin/components/AdminBlogView.js +53 -83
  57. package/dist/features/admin/components/AdminBrandsView.d.ts +2 -3
  58. package/dist/features/admin/components/AdminBrandsView.js +84 -83
  59. package/dist/features/admin/components/AdminBundlesView.js +82 -125
  60. package/dist/features/admin/components/AdminCarouselView.d.ts +2 -2
  61. package/dist/features/admin/components/AdminCarouselView.js +17 -52
  62. package/dist/features/admin/components/AdminCartsView.d.ts +2 -3
  63. package/dist/features/admin/components/AdminCartsView.js +39 -88
  64. package/dist/features/admin/components/AdminCategoriesView.d.ts +3 -3
  65. package/dist/features/admin/components/AdminCategoriesView.js +98 -92
  66. package/dist/features/admin/components/AdminCategoryEditorView.js +2 -2
  67. package/dist/features/admin/components/AdminClassifiedView.d.ts +3 -0
  68. package/dist/features/admin/components/AdminClassifiedView.js +44 -0
  69. package/dist/features/admin/components/AdminContactView.d.ts +2 -2
  70. package/dist/features/admin/components/AdminContactView.js +104 -111
  71. package/dist/features/admin/components/AdminCouponsView.d.ts +3 -6
  72. package/dist/features/admin/components/AdminCouponsView.js +66 -86
  73. package/dist/features/admin/components/AdminDigitalCodesView.d.ts +3 -0
  74. package/dist/features/admin/components/AdminDigitalCodesView.js +51 -0
  75. package/dist/features/admin/components/AdminFaqsView.d.ts +4 -4
  76. package/dist/features/admin/components/AdminFaqsView.js +77 -33
  77. package/dist/features/admin/components/AdminFeaturesView.d.ts +2 -3
  78. package/dist/features/admin/components/AdminFeaturesView.js +57 -70
  79. package/dist/features/admin/components/AdminGroupedListingsView.d.ts +3 -0
  80. package/dist/features/admin/components/AdminGroupedListingsView.js +43 -0
  81. package/dist/features/admin/components/AdminHistoryView.d.ts +2 -3
  82. package/dist/features/admin/components/AdminHistoryView.js +35 -52
  83. package/dist/features/admin/components/AdminListingScaffold.d.ts +2 -2
  84. package/dist/features/admin/components/AdminListingScaffold.js +3 -3
  85. package/dist/features/admin/components/AdminLiveView.d.ts +3 -0
  86. package/dist/features/admin/components/AdminLiveView.js +50 -0
  87. package/dist/features/admin/components/AdminNewsletterView.d.ts +2 -2
  88. package/dist/features/admin/components/AdminNewsletterView.js +67 -97
  89. package/dist/features/admin/components/AdminNotificationsView.d.ts +2 -3
  90. package/dist/features/admin/components/AdminNotificationsView.js +67 -93
  91. package/dist/features/admin/components/AdminOrderEditorView.js +10 -10
  92. package/dist/features/admin/components/AdminOrdersView.d.ts +2 -3
  93. package/dist/features/admin/components/AdminOrdersView.js +93 -107
  94. package/dist/features/admin/components/AdminPayoutsView.d.ts +2 -3
  95. package/dist/features/admin/components/AdminPayoutsView.js +51 -91
  96. package/dist/features/admin/components/AdminPrizeDrawsView.d.ts +2 -3
  97. package/dist/features/admin/components/AdminPrizeDrawsView.js +39 -76
  98. package/dist/features/admin/components/AdminProductEditorView.js +3 -3
  99. package/dist/features/admin/components/AdminProductsView.d.ts +4 -4
  100. package/dist/features/admin/components/AdminProductsView.js +167 -163
  101. package/dist/features/admin/components/AdminReturnRequestsView.d.ts +1 -1
  102. package/dist/features/admin/components/AdminReturnRequestsView.js +64 -66
  103. package/dist/features/admin/components/AdminReviewsView.d.ts +3 -7
  104. package/dist/features/admin/components/AdminReviewsView.js +94 -110
  105. package/dist/features/admin/components/AdminScammersView.d.ts +2 -3
  106. package/dist/features/admin/components/AdminScammersView.js +53 -97
  107. package/dist/features/admin/components/AdminSectionsView.js +1 -1
  108. package/dist/features/admin/components/AdminSessionsView.d.ts +2 -3
  109. package/dist/features/admin/components/AdminSessionsView.js +62 -89
  110. package/dist/features/admin/components/AdminSiteSettingsView.js +4 -5
  111. package/dist/features/admin/components/AdminStoreAddressesView.d.ts +1 -1
  112. package/dist/features/admin/components/AdminStoreAddressesView.js +39 -53
  113. package/dist/features/admin/components/AdminStoreEditorView.js +21 -8
  114. package/dist/features/admin/components/AdminStoresView.d.ts +2 -3
  115. package/dist/features/admin/components/AdminStoresView.js +67 -99
  116. package/dist/features/admin/components/AdminSublistingCategoriesView.d.ts +1 -1
  117. package/dist/features/admin/components/AdminSublistingCategoriesView.js +28 -44
  118. package/dist/features/admin/components/AdminSupportTicketDetailView.d.ts +10 -1
  119. package/dist/features/admin/components/AdminSupportTicketDetailView.js +191 -5
  120. package/dist/features/admin/components/AdminSupportTicketsView.d.ts +2 -3
  121. package/dist/features/admin/components/AdminSupportTicketsView.js +65 -96
  122. package/dist/features/admin/components/AdminTeamView.d.ts +2 -2
  123. package/dist/features/admin/components/AdminTeamView.js +40 -74
  124. package/dist/features/admin/components/AdminUserEditorView.d.ts +11 -1
  125. package/dist/features/admin/components/AdminUserEditorView.js +77 -7
  126. package/dist/features/admin/components/AdminUsersView.d.ts +2 -3
  127. package/dist/features/admin/components/AdminUsersView.js +108 -100
  128. package/dist/features/admin/components/AdminViewCards.d.ts +1 -1
  129. package/dist/features/admin/components/AdminViewCards.js +15 -15
  130. package/dist/features/admin/components/AdminWishlistsView.d.ts +2 -3
  131. package/dist/features/admin/components/AdminWishlistsView.js +36 -62
  132. package/dist/features/admin/components/DataListingView.d.ts +122 -0
  133. package/dist/features/admin/components/DataListingView.js +66 -0
  134. package/dist/features/admin/components/index.d.ts +10 -4
  135. package/dist/features/admin/components/index.js +6 -2
  136. package/dist/features/admin/constants/filter-tabs.d.ts +23 -17
  137. package/dist/features/admin/constants/filter-tabs.js +21 -17
  138. package/dist/features/admin/hooks/useAdminListing.d.ts +1 -0
  139. package/dist/features/admin/hooks/useAdminListing.js +1 -1
  140. package/dist/features/admin/schemas/firestore.js +6 -7
  141. package/dist/features/auctions/server.d.ts +0 -1
  142. package/dist/features/auctions/server.js +0 -1
  143. package/dist/features/auth/actions/realtime-token-actions.js +1 -1
  144. package/dist/features/auth/repository/user.repository.js +1 -1
  145. package/dist/features/blog/components/BlogFeaturedCard.js +1 -0
  146. package/dist/features/cart/repository/cart.repository.d.ts +4 -1
  147. package/dist/features/cart/repository/cart.repository.js +12 -0
  148. package/dist/features/checkout/hooks/useCheckoutApi.d.ts +0 -2
  149. package/dist/features/checkout/index.d.ts +1 -1
  150. package/dist/features/events/components/AdminEventEditorView.js +10 -13
  151. package/dist/features/events/components/AdminEventsView.d.ts +3 -3
  152. package/dist/features/events/components/AdminEventsView.js +50 -86
  153. package/dist/features/events/components/EventCard.js +1 -0
  154. package/dist/features/events/components/EventOfferCard.d.ts +19 -0
  155. package/dist/features/events/components/EventOfferCard.js +29 -0
  156. package/dist/features/events/components/EventRaffleEntryForm.d.ts +25 -0
  157. package/dist/features/events/components/EventRaffleEntryForm.js +37 -0
  158. package/dist/features/events/components/EventRafflesSection.d.ts +1 -4
  159. package/dist/features/events/components/EventRafflesSection.js +17 -6
  160. package/dist/features/events/components/EventSaleBanner.d.ts +21 -0
  161. package/dist/features/events/components/EventSaleBanner.js +18 -0
  162. package/dist/features/events/components/index.d.ts +6 -0
  163. package/dist/features/events/components/index.js +4 -0
  164. package/dist/features/events/repository/event-entry.repository.d.ts +5 -0
  165. package/dist/features/events/repository/event-entry.repository.js +7 -0
  166. package/dist/features/faq/components/FAQPageContent.js +1 -0
  167. package/dist/features/filters/AsyncFacetSection.d.ts +1 -1
  168. package/dist/features/homepage/components/AdvertisementBanner.js +6 -6
  169. package/dist/features/homepage/components/FAQSection.d.ts +0 -5
  170. package/dist/features/homepage/components/HomepageSkeleton.js +2 -2
  171. package/dist/features/homepage/components/WelcomeSection.js +3 -3
  172. package/dist/features/homepage/lib/live-stats.js +1 -1
  173. package/dist/features/homepage/schemas/firestore.d.ts +0 -2
  174. package/dist/features/layout/TitleBar.js +1 -0
  175. package/dist/features/layout/index.d.ts +0 -2
  176. package/dist/features/layout/index.js +0 -1
  177. package/dist/features/pre-orders/server.d.ts +0 -1
  178. package/dist/features/pre-orders/server.js +0 -1
  179. package/dist/features/products/components/GroupSettingsPanel.js +2 -2
  180. package/dist/features/products/components/PrizeDrawItemsEditor.js +2 -2
  181. package/dist/features/products/components/PrizeDrawsSection.d.ts +1 -4
  182. package/dist/features/products/components/PrizeDrawsSection.js +17 -6
  183. package/dist/features/products/components/PrizeRevealModal.js +1 -1
  184. package/dist/features/products/components/ProductCardMetadataSection.d.ts +11 -0
  185. package/dist/features/products/components/ProductCardMetadataSection.js +25 -0
  186. package/dist/features/products/components/ProductDetailPageView.js +3 -1
  187. package/dist/features/products/components/ProductFeaturesSelector.js +1 -1
  188. package/dist/features/products/components/ProductGradingTab.d.ts +13 -0
  189. package/dist/features/products/components/ProductGradingTab.js +25 -0
  190. package/dist/features/products/components/ProductGrid.js +15 -2
  191. package/dist/features/products/components/ProductTabsShell.d.ts +5 -1
  192. package/dist/features/products/components/ProductTabsShell.js +6 -1
  193. package/dist/features/products/components/index.d.ts +4 -0
  194. package/dist/features/products/components/index.js +3 -0
  195. package/dist/features/products/constants/action-defs.d.ts +5 -0
  196. package/dist/features/products/constants/action-defs.js +52 -32
  197. package/dist/features/products/constants/sieve.d.ts +24 -4
  198. package/dist/features/products/constants/sieve.js +20 -11
  199. package/dist/features/products/schemas/firestore.d.ts +17 -0
  200. package/dist/features/products/schemas/product-features.validators.d.ts +2 -2
  201. package/dist/features/products/schemas/product-templates.d.ts +2 -4
  202. package/dist/features/products/types/index.d.ts +4 -0
  203. package/dist/features/promotions/components/CouponsIndexListing.js +4 -4
  204. package/dist/features/promotions/server.d.ts +0 -1
  205. package/dist/features/promotions/server.js +0 -1
  206. package/dist/features/reviews/components/ReviewDetailShell.js +3 -3
  207. package/dist/features/search/api/route.js +44 -1
  208. package/dist/features/search/components/Search.js +2 -0
  209. package/dist/features/search/hooks/useNavSuggestions.d.ts +5 -1
  210. package/dist/features/search/hooks/useNavSuggestions.js +31 -4
  211. package/dist/features/seller/components/BrandInlineSelect.js +2 -2
  212. package/dist/features/seller/components/CategoryInlineSelect.js +2 -2
  213. package/dist/features/seller/components/SellerAddressesView.js +4 -5
  214. package/dist/features/seller/components/SellerAuctionsView.d.ts +3 -3
  215. package/dist/features/seller/components/SellerAuctionsView.js +60 -90
  216. package/dist/features/seller/components/SellerBidsView.js +1 -1
  217. package/dist/features/seller/components/SellerBundlesView.js +64 -89
  218. package/dist/features/seller/components/SellerClassifiedView.js +67 -90
  219. package/dist/features/seller/components/SellerCouponEditorView.js +1 -1
  220. package/dist/features/seller/components/SellerCouponsView.d.ts +2 -2
  221. package/dist/features/seller/components/SellerCouponsView.js +45 -84
  222. package/dist/features/seller/components/SellerDigitalCodesView.js +63 -88
  223. package/dist/features/seller/components/SellerGroupedListingsView.js +33 -49
  224. package/dist/features/seller/components/SellerLiveView.js +63 -84
  225. package/dist/features/seller/components/SellerOffersPanel.js +1 -1
  226. package/dist/features/seller/components/SellerOffersView.d.ts +2 -2
  227. package/dist/features/seller/components/SellerOffersView.js +37 -69
  228. package/dist/features/seller/components/SellerOrdersView.d.ts +2 -2
  229. package/dist/features/seller/components/SellerOrdersView.js +4 -4
  230. package/dist/features/seller/components/SellerPayoutMethodsView.js +1 -1
  231. package/dist/features/seller/components/SellerPayoutsView.d.ts +2 -2
  232. package/dist/features/seller/components/SellerPayoutsView.js +34 -68
  233. package/dist/features/seller/components/SellerPreOrdersView.d.ts +2 -2
  234. package/dist/features/seller/components/SellerPreOrdersView.js +49 -82
  235. package/dist/features/seller/components/SellerPrizeDrawsView.d.ts +2 -2
  236. package/dist/features/seller/components/SellerPrizeDrawsView.js +49 -82
  237. package/dist/features/seller/components/SellerProductShell.d.ts +1 -1
  238. package/dist/features/seller/components/SellerProductsView.d.ts +2 -2
  239. package/dist/features/seller/components/SellerProductsView.js +15 -10
  240. package/dist/features/seller/components/SellerShippingConfigsView.js +1 -1
  241. package/dist/features/seller/components/SellerSidebar.d.ts +0 -4
  242. package/dist/features/seller/components/SellerSidebar.js +0 -2
  243. package/dist/features/seller/components/SellerStoreCategoriesView.js +1 -1
  244. package/dist/features/seller/components/SellerTemplatesView.js +2 -2
  245. package/dist/features/seller/components/SellersListView.d.ts +1 -2
  246. package/dist/features/seller/components/analytics/SellerAnalyticsStats.d.ts +5 -0
  247. package/dist/features/seller/components/analytics/SellerAnalyticsStats.js +2 -8
  248. package/dist/features/seller/components/index.d.ts +0 -3
  249. package/dist/features/seller/components/index.js +0 -2
  250. package/dist/features/seller/server.d.ts +0 -1
  251. package/dist/features/seller/server.js +0 -1
  252. package/dist/features/shell/FormShell.d.ts +1 -1
  253. package/dist/features/shell/FormShell.js +7 -4
  254. package/dist/features/shell/field-groups/ImageFieldGroup.d.ts +18 -0
  255. package/dist/features/shell/field-groups/ImageFieldGroup.js +15 -0
  256. package/dist/features/shell/field-groups/SeoFieldGroup.d.ts +22 -0
  257. package/dist/features/shell/field-groups/SeoFieldGroup.js +16 -0
  258. package/dist/features/shell/field-groups/StatusFieldGroup.d.ts +35 -0
  259. package/dist/features/shell/field-groups/StatusFieldGroup.js +16 -0
  260. package/dist/features/shell/field-groups/TitleDescriptionGroup.d.ts +40 -0
  261. package/dist/features/shell/field-groups/TitleDescriptionGroup.js +16 -0
  262. package/dist/features/shell/field-groups/index.d.ts +13 -0
  263. package/dist/features/shell/field-groups/index.js +9 -0
  264. package/dist/features/shell/index.d.ts +2 -0
  265. package/dist/features/shell/index.js +1 -0
  266. package/dist/features/stores/components/StoreCapabilitiesGuideView.d.ts +1 -2
  267. package/dist/features/stores/components/StoreFinanceGuideView.d.ts +1 -2
  268. package/dist/features/stores/components/StoreHeader.js +2 -1
  269. package/dist/features/stores/components/StoreListingsGuideView.d.ts +1 -2
  270. package/dist/features/stores/components/StoreOrdersGuideView.d.ts +1 -2
  271. package/dist/features/stores/components/StoreScopedSearch.d.ts +16 -0
  272. package/dist/features/stores/components/StoreScopedSearch.js +27 -0
  273. package/dist/features/stores/components/StoreSettingsGuideView.d.ts +1 -2
  274. package/dist/features/stores/server.d.ts +0 -1
  275. package/dist/features/stores/server.js +0 -1
  276. package/dist/features/support/schemas/firestore.d.ts +22 -1
  277. package/dist/features/support/schemas/firestore.js +10 -0
  278. package/dist/features/wishlist/server.d.ts +0 -1
  279. package/dist/features/wishlist/server.js +0 -1
  280. package/dist/index.d.ts +9 -27
  281. package/dist/index.js +14 -50
  282. package/dist/next/routing/route-map.d.ts +8 -0
  283. package/dist/next/routing/route-map.js +4 -0
  284. package/dist/react/hooks/useListingTypeFlags.d.ts +32 -0
  285. package/dist/react/hooks/useListingTypeFlags.js +19 -0
  286. package/dist/security/index.d.ts +1 -1
  287. package/dist/security/index.js +1 -1
  288. package/dist/security/pii-redact.d.ts +8 -0
  289. package/dist/security/pii-redact.js +10 -1
  290. package/dist/seed/grouped-listings-seed-data.d.ts +4 -0
  291. package/dist/seed/products-preorders-seed-data.d.ts +4 -0
  292. package/dist/seed/products-prize-draws-seed-data.js +3 -0
  293. package/dist/seed/site-settings-seed-data.js +5 -5
  294. package/dist/seed/sub-listings-seed-data.d.ts +4 -0
  295. package/dist/server.d.ts +2 -0
  296. package/dist/server.js +4 -0
  297. package/dist/styles.css +54 -395
  298. package/dist/tailwind-utilities.css +1 -1
  299. package/dist/ui/components/BaseListingCard.d.ts +10 -0
  300. package/dist/ui/components/BaseListingCard.js +17 -1
  301. package/dist/ui/components/DetailPageGallery.d.ts +32 -0
  302. package/dist/ui/components/DetailPageGallery.js +47 -0
  303. package/dist/ui/components/DetailPageHero.d.ts +30 -0
  304. package/dist/ui/components/DetailPageHero.js +22 -0
  305. package/dist/ui/components/DetailPageTabs.d.ts +34 -0
  306. package/dist/ui/components/DetailPageTabs.js +38 -0
  307. package/dist/ui/components/HorizontalScroller.style.css +15 -2
  308. package/dist/ui/components/ListingLayout.d.ts +11 -2
  309. package/dist/ui/components/ListingLayout.js +12 -6
  310. package/dist/ui/components/PaginatedSelect.d.ts +66 -0
  311. package/dist/ui/components/PaginatedSelect.js +201 -0
  312. package/dist/ui/components/PaginatedSelect.style.css +254 -0
  313. package/dist/ui/components/Semantic.d.ts +0 -4
  314. package/dist/ui/components/Semantic.js +0 -2
  315. package/dist/ui/components/SettingsSection.d.ts +47 -0
  316. package/dist/ui/components/SettingsSection.js +38 -0
  317. package/dist/ui/components/index.style.css +1 -4
  318. package/dist/ui/index.d.ts +12 -14
  319. package/dist/ui/index.js +6 -7
  320. package/dist/utils/id-generators.d.ts +1 -18
  321. package/dist/utils/id-generators.js +51 -18
  322. package/dist/validation/schemas.d.ts +25 -0
  323. package/dist/validation/schemas.js +28 -0
  324. package/package.json +1 -1
@@ -1,66 +1,29 @@
1
1
  "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import React, { useState, useCallback } from "react";
4
- import { useUrlTable } from "../../../react/hooks/useUrlTable";
5
- import { useBulkSelection } from "../../../react/hooks/useBulkSelection";
6
- import { AdminViewCards } from "../../admin/components/AdminViewCards";
7
- import { FilterChipGroup, ListingFilterDrawer, ListingToolbar, Pagination, ListingViewShell, RowActionMenu } from "../../../ui";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import React from "react";
4
+ import { FilterChipGroup, ListingLayout, RowActionMenu } from "../../../ui";
8
5
  import { SELLER_ENDPOINTS } from "../../../constants/api-endpoints";
9
6
  import { ADMIN_PAYOUT_STATUS_TABS } from "../../admin/constants/filter-tabs";
10
7
  import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
11
- import { toRecordArray, toRelativeDate, toRupees, toStringValue, useSellerListingData, } from "../hooks/useSellerListingData";
12
- import { DataTable } from "../../admin/components/DataTable";
13
- const PAGE_SIZE = 25;
14
- const FILTER_KEYS = ["status"];
15
- const DEFAULT_SORT = "-createdAt";
16
- const SORT_OPTIONS = [
17
- { value: "-createdAt", label: "Newest" },
18
- { value: "createdAt", label: "Oldest" },
19
- ];
20
- const STATUS_OPTIONS = ADMIN_PAYOUT_STATUS_TABS;
8
+ import { toRecordArray, toRelativeDate, toRupees, toStringValue, } from "../../admin/hooks/useAdminListingData";
9
+ import { DataListingView } from "../../admin/components/DataListingView";
21
10
  export function SellerPayoutsView({ children, onViewClick, onExportClick, ...props }) {
22
- const hasChildren = React.Children.count(children) > 0;
23
- const [view, setView] = useState("table");
24
- const table = useUrlTable({ defaults: { pageSize: String(PAGE_SIZE), sort: DEFAULT_SORT } });
25
- const [searchInput, setSearchInput] = useState(table.get("q") || "");
26
- const [filterOpen, setFilterOpen] = useState(false);
27
- const [pendingFilters, setPendingFilters] = useState(() => Object.fromEntries(FILTER_KEYS.map((k) => [k, table.get(k)])));
28
- const openFilters = useCallback(() => {
29
- setPendingFilters(Object.fromEntries(FILTER_KEYS.map((k) => [k, table.get(k)])));
30
- setFilterOpen(true);
31
- }, [table]);
32
- const applyFilters = useCallback(() => {
33
- const updates = { page: "1" };
34
- for (const k of FILTER_KEYS)
35
- updates[k] = pendingFilters[k] ?? "";
36
- table.setMany(updates);
37
- setFilterOpen(false);
38
- }, [pendingFilters, table]);
39
- const clearFilters = useCallback(() => {
40
- setPendingFilters(Object.fromEntries(FILTER_KEYS.map((k) => [k, ""])));
41
- }, []);
42
- const resetAll = useCallback(() => {
43
- const updates = { q: "", sort: "" };
44
- for (const k of FILTER_KEYS)
45
- updates[k] = "";
46
- table.setMany(updates);
47
- setSearchInput("");
48
- }, [table]);
49
- const commitSearch = useCallback(() => {
50
- table.set("q", searchInput.trim());
51
- }, [searchInput, table]);
52
- const activeFilterCount = FILTER_KEYS.filter((k) => !!table.get(k)).length;
53
- const hasActiveState = !!table.get("q") || table.get("sort") !== DEFAULT_SORT || activeFilterCount > 0;
54
- const statusRaw = table.get("status");
55
- const filters = statusRaw && statusRaw !== "All" ? `status==${statusRaw}` : undefined;
56
- const { rows, total, isLoading, errorMessage } = useSellerListingData({
11
+ if (React.Children.count(children) > 0) {
12
+ return (_jsx(ListingLayout, { portal: "seller", ...props, children: children }));
13
+ }
14
+ const config = {
15
+ portal: "seller",
16
+ title: "Payouts",
17
+ searchPlaceholder: "Search payouts by payout # or amount",
18
+ emptyLabel: "No payouts found",
19
+ filterKeys: ["status"],
20
+ defaultSort: "-createdAt",
57
21
  queryKey: ["seller", "payouts", "listing"],
58
22
  endpoint: SELLER_ENDPOINTS.PAYOUTS,
59
- page: table.getNumber("page", 1),
60
- pageSize: PAGE_SIZE,
61
- sorts: table.get("sort") || DEFAULT_SORT,
62
- filters,
63
- q: table.get("q") || undefined,
23
+ sortOptions: [
24
+ { value: "-createdAt", label: "Newest" },
25
+ { value: "createdAt", label: "Oldest" },
26
+ ],
64
27
  mapRows: (response) => toRecordArray(response.payouts).map((item, index) => ({
65
28
  id: toStringValue(item.id, `payout-${index}`),
66
29
  primary: `Payout #${toStringValue(item.payoutNumber ?? item.id, "Unknown")}`,
@@ -71,16 +34,19 @@ export function SellerPayoutsView({ children, onViewClick, onExportClick, ...pro
71
34
  status: toStringValue(item.status, "Pending"),
72
35
  updatedAt: toRelativeDate(item.processedAt ?? item.updatedAt ?? item.createdAt),
73
36
  })),
74
- getTotal: (response, mappedRows) => typeof response.meta?.total === "number" ? response.meta.total : mappedRows.length,
75
- });
76
- const currentPage = table.getNumber("page", 1);
77
- const totalPages = Math.ceil(total / PAGE_SIZE);
78
- const selection = useBulkSelection({ items: rows, keyExtractor: (r) => r.id });
79
- if (hasChildren) {
80
- return _jsx(ListingViewShell, { portal: "seller", ...props, children: children });
81
- }
82
- return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search payouts by payout # or amount", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => { table.set("sort", v); }, showTableView: true, view: view, onViewChange: (v) => setView(v), onResetAll: resetAll, hasActiveState: hasActiveState }), totalPages > 1 && (_jsx("div", { className: "sticky top-[calc(var(--header-height,0px)+44px)] z-10 flex justify-center bg-white/95 dark:bg-slate-900/95 backdrop-blur-sm border-b border-zinc-200 dark:border-slate-700 px-3 py-1.5", children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsxs("div", { className: "py-4 px-3 sm:px-4", children: [errorMessage && (_jsx("div", { className: "mb-4 rounded-xl border border-red-200 bg-error-surface px-4 py-3 text-sm text-error dark:border-red-900/60", children: errorMessage })), view === "table" ? (_jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No payouts found", renderRowActions: (row) => (_jsx(RowActionMenu, { actions: [
83
- ...(onViewClick ? [{ label: ACTIONS.STORE["view-payout"].label, onClick: () => onViewClick(row.id) }] : []),
84
- ...(onExportClick ? [{ label: ACTIONS.STORE["export-payout"].label, onClick: () => onExportClick(row.id) }] : []),
85
- ] })) })) : (_jsx(AdminViewCards, { rows: rows, view: view, isLoading: isLoading, emptyLabel: "No payouts found", onRowClick: undefined, selectedIdSet: selection.selectedIdSet, onToggleSelect: selection.toggle }))] }), _jsx(ListingFilterDrawer, { open: filterOpen, onClose: () => setFilterOpen(false), onApply: applyFilters, onClear: clearFilters, activeCount: activeFilterCount, children: _jsx(FilterChipGroup, { label: "Status", tabs: STATUS_OPTIONS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) }) })] }));
37
+ getTotal: (response, mappedRows) => typeof response.meta?.total === "number"
38
+ ? response.meta.total
39
+ : mappedRows.length,
40
+ buildFilters: (state) => state.status && state.status !== "All" ? `status==${state.status}` : undefined,
41
+ renderRowActions: (row) => (_jsx(RowActionMenu, { actions: [
42
+ ...(onViewClick
43
+ ? [{ label: ACTIONS.STORE["view-payout"].label, onClick: () => onViewClick(row.id) }]
44
+ : []),
45
+ ...(onExportClick
46
+ ? [{ label: ACTIONS.STORE["export-payout"].label, onClick: () => onExportClick(row.id) }]
47
+ : []),
48
+ ] })),
49
+ renderFilterPanel: ({ pendingFilters, setPendingFilters }) => (_jsx(FilterChipGroup, { label: "Status", tabs: ADMIN_PAYOUT_STATUS_TABS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) })),
50
+ };
51
+ return _jsx(DataListingView, { config: config });
86
52
  }
@@ -1,5 +1,5 @@
1
- import type { ListingViewShellProps } from "../../../ui";
2
- export interface SellerPreOrdersViewProps extends ListingViewShellProps {
1
+ import type { ListingLayoutProps } from "../../../ui";
2
+ export interface SellerPreOrdersViewProps extends ListingLayoutProps {
3
3
  onDelete?: (id: string) => Promise<void>;
4
4
  }
5
5
  export declare function SellerPreOrdersView({ children, onDelete, ...props }: SellerPreOrdersViewProps): import("react/jsx-runtime").JSX.Element;
@@ -1,29 +1,15 @@
1
1
  "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import React, { useState, useCallback } from "react";
4
4
  import { useEntityDelete } from "../../../react/hooks/useEntityDelete";
5
- import { useUrlTable } from "../../../react/hooks/useUrlTable";
6
- import { useBulkSelection } from "../../../react/hooks/useBulkSelection";
7
- import { Alert, Badge, ConfirmDeleteModal, Div, FilterChipGroup, ListingFilterDrawer, ListingToolbar, ListingViewShell, Pagination, RowActionMenu, Text } from "../../../ui";
5
+ import { Badge, ConfirmDeleteModal, FilterChipGroup, ListingLayout, RowActionMenu, Text } from "../../../ui";
8
6
  import { SELLER_ENDPOINTS } from "../../../constants/api-endpoints";
9
7
  import { SELLER_PRE_ORDER_STATUS_TABS } from "../../admin/constants/filter-tabs";
10
8
  import { ROUTES } from "../../../constants";
11
9
  import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
12
- import { toRecordArray, toRelativeDate, toRupees, toStringValue, useSellerListingData, } from "../hooks/useSellerListingData";
13
- import { DataTable } from "../../admin/components/DataTable";
10
+ import { toRecordArray, toRelativeDate, toRupees, toStringValue, } from "../../admin/hooks/useAdminListingData";
11
+ import { DataListingView } from "../../admin/components/DataListingView";
14
12
  import { useActionDispatch } from "../../../react/hooks/use-action-dispatch";
15
- const PAGE_SIZE = 25;
16
- const FILTER_KEYS = ["status"];
17
- const DEFAULT_SORT = "-createdAt";
18
- // Hardcoded sieve clause — this view only ever shows pre-orders.
19
- const LISTING_TYPE_FILTER = "listingType==pre-order";
20
- const SORT_OPTIONS = [
21
- { value: "-createdAt", label: "Newest" },
22
- { value: "createdAt", label: "Oldest" },
23
- { value: "title", label: "Title A–Z" },
24
- { value: "preorderAvailableDate", label: "Delivery Soon" },
25
- ];
26
- const STATUS_OPTIONS = SELLER_PRE_ORDER_STATUS_TABS;
27
13
  const PRE_ORDER_COLUMNS = [
28
14
  {
29
15
  key: "thumbnail",
@@ -71,8 +57,6 @@ const PRE_ORDER_COLUMNS = [
71
57
  },
72
58
  ];
73
59
  export function SellerPreOrdersView({ children, onDelete, ...props }) {
74
- const hasChildren = React.Children.count(children) > 0;
75
- const [view, setView] = useState("table");
76
60
  const dispatch = useActionDispatch();
77
61
  const [deleteTargetId, setDeleteTargetId] = useState(null);
78
62
  const { deletingId, handleDelete: performDelete } = useEntityDelete({
@@ -81,47 +65,29 @@ export function SellerPreOrdersView({ children, onDelete, ...props }) {
81
65
  successMessage: "Pre-order deleted.",
82
66
  fetchOptions: { credentials: "include" },
83
67
  });
84
- const table = useUrlTable({ defaults: { pageSize: String(PAGE_SIZE), sort: DEFAULT_SORT } });
85
- const [searchInput, setSearchInput] = useState(table.get("q") || "");
86
- const [filterOpen, setFilterOpen] = useState(false);
87
- const [pendingFilters, setPendingFilters] = useState(() => Object.fromEntries(FILTER_KEYS.map((k) => [k, table.get(k)])));
88
- const openFilters = useCallback(() => {
89
- setPendingFilters(Object.fromEntries(FILTER_KEYS.map((k) => [k, table.get(k)])));
90
- setFilterOpen(true);
91
- }, [table]);
92
- const applyFilters = useCallback(() => {
93
- const updates = { page: "1" };
94
- for (const k of FILTER_KEYS)
95
- updates[k] = pendingFilters[k] ?? "";
96
- table.setMany(updates);
97
- setFilterOpen(false);
98
- }, [pendingFilters, table]);
99
- const clearFilters = useCallback(() => {
100
- setPendingFilters(Object.fromEntries(FILTER_KEYS.map((k) => [k, ""])));
101
- }, []);
102
- const resetAll = useCallback(() => {
103
- const updates = { q: "", sort: "" };
104
- for (const k of FILTER_KEYS)
105
- updates[k] = "";
106
- table.setMany(updates);
107
- setSearchInput("");
108
- }, [table]);
109
- const commitSearch = useCallback(() => {
110
- table.set("q", searchInput.trim());
111
- }, [searchInput, table]);
112
- const activeFilterCount = FILTER_KEYS.filter((k) => !!table.get(k)).length;
113
- const hasActiveState = !!table.get("q") || table.get("sort") !== DEFAULT_SORT || activeFilterCount > 0;
114
- const statusRaw = table.get("status");
115
- const statusFilter = statusRaw && statusRaw !== "All" ? `status==${statusRaw}` : undefined;
116
- const filters = [LISTING_TYPE_FILTER, statusFilter].filter(Boolean).join(",");
117
- const { rows, total, isLoading, errorMessage } = useSellerListingData({
68
+ const handleDelete = useCallback(async (id) => {
69
+ await performDelete(id);
70
+ setDeleteTargetId(null);
71
+ }, [performDelete]);
72
+ if (React.Children.count(children) > 0) {
73
+ return (_jsx(ListingLayout, { portal: "seller", ...props, children: children }));
74
+ }
75
+ const config = {
76
+ portal: "seller",
77
+ title: "Pre-Orders",
78
+ searchPlaceholder: "Search pre-orders by name…",
79
+ emptyLabel: "No pre-orders listed yet",
80
+ filterKeys: ["status"],
81
+ defaultSort: "-createdAt",
118
82
  queryKey: ["seller", "pre-orders", "listing"],
119
83
  endpoint: SELLER_ENDPOINTS.PRODUCTS,
120
- page: table.getNumber("page", 1),
121
- pageSize: PAGE_SIZE,
122
- sorts: table.get("sort") || DEFAULT_SORT,
123
- filters,
124
- q: table.get("q") || undefined,
84
+ sortOptions: [
85
+ { value: "-createdAt", label: "Newest" },
86
+ { value: "createdAt", label: "Oldest" },
87
+ { value: "title", label: "Title A–Z" },
88
+ { value: "preorderAvailableDate", label: "Delivery Soon" },
89
+ ],
90
+ columns: PRE_ORDER_COLUMNS,
125
91
  mapRows: (response) => toRecordArray(response.products).map((item, index) => {
126
92
  const priceRaw = typeof item.price === "number" ? item.price : 0;
127
93
  return {
@@ -138,27 +104,28 @@ export function SellerPreOrdersView({ children, onDelete, ...props }) {
138
104
  };
139
105
  }),
140
106
  getTotal: (response, mappedRows) => typeof response.meta?.total === "number" ? response.meta.total : mappedRows.length,
141
- });
142
- const currentPage = table.getNumber("page", 1);
143
- const totalPages = Math.ceil(total / PAGE_SIZE);
144
- const selection = useBulkSelection({ items: rows, keyExtractor: (r) => r.id });
145
- const handleDelete = useCallback(async (id) => {
146
- await performDelete(id);
147
- setDeleteTargetId(null);
148
- }, [performDelete]);
149
- if (hasChildren) {
150
- return (_jsx(ListingViewShell, { portal: "seller", ...props, children: children }));
151
- }
152
- return (_jsxs(Div, { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search pre-orders by name\u2026", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => { table.set("sort", v); }, showTableView: true, view: view, onViewChange: (v) => setView(v), onResetAll: resetAll, hasActiveState: hasActiveState }), totalPages > 1 && (_jsx("div", { className: "sticky z-10 flex justify-center bg-[var(--appkit-color-surface)]/95 backdrop-blur-sm border-b border-[var(--appkit-color-border)] px-3 py-1.5", style: { top: "calc(var(--header-height, 0px) + 44px)" }, children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsxs("div", { className: "py-4 px-3 sm:px-4", children: [errorMessage && (_jsx(Alert, { variant: "error", className: "mb-4", children: errorMessage })), _jsx(DataTable, { columns: PRE_ORDER_COLUMNS, rows: rows, isLoading: isLoading, emptyLabel: "No pre-orders listed yet", getRowHref: (row) => String(ROUTES.STORE.PRE_ORDERS_EDIT(row.id)), renderRowActions: (row) => (_jsx(RowActionMenu, { actions: [
153
- {
154
- label: ACTIONS.STORE["edit-listing"].label,
155
- onClick: () => void dispatch({ type: "NAVIGATE", href: String(ROUTES.STORE.PRE_ORDERS_EDIT(row.id)) }),
156
- },
157
- ...(onDelete ? [{
158
- label: ACTIONS.STORE["delete-listing"].label,
159
- destructive: true,
160
- onClick: () => setDeleteTargetId(row.id),
161
- disabled: deletingId === row.id,
162
- }] : []),
163
- ] })) })] }), _jsx(ListingFilterDrawer, { open: filterOpen, onClose: () => setFilterOpen(false), onApply: applyFilters, onClear: clearFilters, activeCount: activeFilterCount, children: _jsx(FilterChipGroup, { label: "Status", tabs: STATUS_OPTIONS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) }) }), deleteTargetId && (_jsx(ConfirmDeleteModal, { isOpen: true, title: "Delete Pre-Order", message: "Are you sure you want to delete this pre-order listing? This cannot be undone.", onConfirm: () => handleDelete(deleteTargetId), onClose: () => setDeleteTargetId(null), isDeleting: deletingId === deleteTargetId }))] }));
107
+ buildFilters: (state) => {
108
+ const status = state.status && state.status !== "All" ? `status==${state.status}` : null;
109
+ return ["listingType==pre-order", status].filter(Boolean).join(",");
110
+ },
111
+ getRowHref: (row) => String(ROUTES.STORE.PRE_ORDERS_EDIT(row.id)),
112
+ renderRowActions: (row) => (_jsx(RowActionMenu, { actions: [
113
+ {
114
+ label: ACTIONS.STORE["edit-listing"].label,
115
+ onClick: () => void dispatch({ type: "NAVIGATE", href: String(ROUTES.STORE.PRE_ORDERS_EDIT(row.id)) }),
116
+ },
117
+ ...(onDelete
118
+ ? [
119
+ {
120
+ label: ACTIONS.STORE["delete-listing"].label,
121
+ destructive: true,
122
+ onClick: () => setDeleteTargetId(row.id),
123
+ disabled: deletingId === row.id,
124
+ },
125
+ ]
126
+ : []),
127
+ ] })),
128
+ renderFilterPanel: ({ pendingFilters, setPendingFilters }) => (_jsx(FilterChipGroup, { label: "Status", tabs: SELLER_PRE_ORDER_STATUS_TABS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) })),
129
+ };
130
+ return (_jsxs(_Fragment, { children: [_jsx(DataListingView, { config: config }), deleteTargetId && (_jsx(ConfirmDeleteModal, { isOpen: true, title: "Delete Pre-Order", message: "Are you sure you want to delete this pre-order listing? This cannot be undone.", onConfirm: () => handleDelete(deleteTargetId), onClose: () => setDeleteTargetId(null), isDeleting: deletingId === deleteTargetId }))] }));
164
131
  }
@@ -1,5 +1,5 @@
1
- import type { ListingViewShellProps } from "../../../ui";
2
- export interface SellerPrizeDrawsViewProps extends ListingViewShellProps {
1
+ import type { ListingLayoutProps } from "../../../ui";
2
+ export interface SellerPrizeDrawsViewProps extends ListingLayoutProps {
3
3
  onDelete?: (id: string) => Promise<void>;
4
4
  }
5
5
  export declare function SellerPrizeDrawsView({ children, onDelete, ...props }: SellerPrizeDrawsViewProps): import("react/jsx-runtime").JSX.Element;
@@ -1,29 +1,15 @@
1
1
  "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import React, { useState, useCallback } from "react";
4
4
  import { useEntityDelete } from "../../../react/hooks/useEntityDelete";
5
- import { useUrlTable } from "../../../react/hooks/useUrlTable";
6
- import { useBulkSelection } from "../../../react/hooks/useBulkSelection";
7
- import { Alert, Badge, ConfirmDeleteModal, Div, FilterChipGroup, ListingFilterDrawer, ListingToolbar, ListingViewShell, Pagination, RowActionMenu, Text } from "../../../ui";
5
+ import { Badge, ConfirmDeleteModal, FilterChipGroup, ListingLayout, RowActionMenu, Text } from "../../../ui";
8
6
  import { SELLER_ENDPOINTS } from "../../../constants/api-endpoints";
9
7
  import { SELLER_PRIZE_DRAW_STATUS_TABS } from "../../admin/constants/filter-tabs";
10
8
  import { ROUTES } from "../../../constants";
11
9
  import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
12
- import { toRecordArray, toRelativeDate, toRupees, toStringValue, useSellerListingData, } from "../hooks/useSellerListingData";
13
- import { DataTable } from "../../admin/components/DataTable";
10
+ import { toRecordArray, toRelativeDate, toRupees, toStringValue, } from "../../admin/hooks/useAdminListingData";
11
+ import { DataListingView } from "../../admin/components/DataListingView";
14
12
  import { useActionDispatch } from "../../../react/hooks/use-action-dispatch";
15
- const PAGE_SIZE = 25;
16
- const FILTER_KEYS = ["status"];
17
- const DEFAULT_SORT = "-createdAt";
18
- // Hardcoded sieve clause — this view only ever shows prize draws.
19
- const LISTING_TYPE_FILTER = "listingType==prize-draw";
20
- const SORT_OPTIONS = [
21
- { value: "-createdAt", label: "Newest" },
22
- { value: "createdAt", label: "Oldest" },
23
- { value: "title", label: "Title A–Z" },
24
- { value: "prizeDrawEndDate", label: "Draw Date Soon" },
25
- ];
26
- const STATUS_OPTIONS = SELLER_PRIZE_DRAW_STATUS_TABS;
27
13
  const STATUS_VARIANT = {
28
14
  active: "success",
29
15
  draft: "default",
@@ -68,8 +54,6 @@ const PRIZE_DRAW_COLUMNS = [
68
54
  },
69
55
  ];
70
56
  export function SellerPrizeDrawsView({ children, onDelete, ...props }) {
71
- const hasChildren = React.Children.count(children) > 0;
72
- const [view, setView] = useState("table");
73
57
  const dispatch = useActionDispatch();
74
58
  const [deleteTargetId, setDeleteTargetId] = useState(null);
75
59
  const { deletingId, handleDelete: performDelete } = useEntityDelete({
@@ -78,47 +62,29 @@ export function SellerPrizeDrawsView({ children, onDelete, ...props }) {
78
62
  successMessage: "Prize draw deleted.",
79
63
  fetchOptions: { credentials: "include" },
80
64
  });
81
- const table = useUrlTable({ defaults: { pageSize: String(PAGE_SIZE), sort: DEFAULT_SORT } });
82
- const [searchInput, setSearchInput] = useState(table.get("q") || "");
83
- const [filterOpen, setFilterOpen] = useState(false);
84
- const [pendingFilters, setPendingFilters] = useState(() => Object.fromEntries(FILTER_KEYS.map((k) => [k, table.get(k)])));
85
- const openFilters = useCallback(() => {
86
- setPendingFilters(Object.fromEntries(FILTER_KEYS.map((k) => [k, table.get(k)])));
87
- setFilterOpen(true);
88
- }, [table]);
89
- const applyFilters = useCallback(() => {
90
- const updates = { page: "1" };
91
- for (const k of FILTER_KEYS)
92
- updates[k] = pendingFilters[k] ?? "";
93
- table.setMany(updates);
94
- setFilterOpen(false);
95
- }, [pendingFilters, table]);
96
- const clearFilters = useCallback(() => {
97
- setPendingFilters(Object.fromEntries(FILTER_KEYS.map((k) => [k, ""])));
98
- }, []);
99
- const resetAll = useCallback(() => {
100
- const updates = { q: "", sort: "" };
101
- for (const k of FILTER_KEYS)
102
- updates[k] = "";
103
- table.setMany(updates);
104
- setSearchInput("");
105
- }, [table]);
106
- const commitSearch = useCallback(() => {
107
- table.set("q", searchInput.trim());
108
- }, [searchInput, table]);
109
- const activeFilterCount = FILTER_KEYS.filter((k) => !!table.get(k)).length;
110
- const hasActiveState = !!table.get("q") || table.get("sort") !== DEFAULT_SORT || activeFilterCount > 0;
111
- const statusRaw = table.get("status");
112
- const statusFilter = statusRaw && statusRaw !== "All" ? `status==${statusRaw}` : undefined;
113
- const filters = [LISTING_TYPE_FILTER, statusFilter].filter(Boolean).join(",");
114
- const { rows, total, isLoading, errorMessage } = useSellerListingData({
65
+ const handleDelete = useCallback(async (id) => {
66
+ await performDelete(id);
67
+ setDeleteTargetId(null);
68
+ }, [performDelete]);
69
+ if (React.Children.count(children) > 0) {
70
+ return (_jsx(ListingLayout, { portal: "seller", ...props, children: children }));
71
+ }
72
+ const config = {
73
+ portal: "seller",
74
+ title: "Prize Draws",
75
+ searchPlaceholder: "Search prize draws by name…",
76
+ emptyLabel: "No prize draws listed yet",
77
+ filterKeys: ["status"],
78
+ defaultSort: "-createdAt",
115
79
  queryKey: ["seller", "prize-draws", "listing"],
116
80
  endpoint: SELLER_ENDPOINTS.PRODUCTS,
117
- page: table.getNumber("page", 1),
118
- pageSize: PAGE_SIZE,
119
- sorts: table.get("sort") || DEFAULT_SORT,
120
- filters,
121
- q: table.get("q") || undefined,
81
+ sortOptions: [
82
+ { value: "-createdAt", label: "Newest" },
83
+ { value: "createdAt", label: "Oldest" },
84
+ { value: "title", label: "Title A–Z" },
85
+ { value: "prizeDrawEndDate", label: "Draw Date Soon" },
86
+ ],
87
+ columns: PRIZE_DRAW_COLUMNS,
122
88
  mapRows: (response) => toRecordArray(response.products).map((item, index) => {
123
89
  const priceRaw = typeof item.price === "number" ? item.price : 0;
124
90
  return {
@@ -135,27 +101,28 @@ export function SellerPrizeDrawsView({ children, onDelete, ...props }) {
135
101
  };
136
102
  }),
137
103
  getTotal: (response, mappedRows) => typeof response.meta?.total === "number" ? response.meta.total : mappedRows.length,
138
- });
139
- const currentPage = table.getNumber("page", 1);
140
- const totalPages = Math.ceil(total / PAGE_SIZE);
141
- const selection = useBulkSelection({ items: rows, keyExtractor: (r) => r.id });
142
- const handleDelete = useCallback(async (id) => {
143
- await performDelete(id);
144
- setDeleteTargetId(null);
145
- }, [performDelete]);
146
- if (hasChildren) {
147
- return (_jsx(ListingViewShell, { portal: "seller", ...props, children: children }));
148
- }
149
- return (_jsxs(Div, { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search prize draws by name\u2026", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => { table.set("sort", v); }, showTableView: true, view: view, onViewChange: (v) => setView(v), onResetAll: resetAll, hasActiveState: hasActiveState }), totalPages > 1 && (_jsx("div", { className: "sticky z-10 flex justify-center bg-[var(--appkit-color-surface)]/95 backdrop-blur-sm border-b border-[var(--appkit-color-border)] px-3 py-1.5", style: { top: "calc(var(--header-height, 0px) + 44px)" }, children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsxs("div", { className: "py-4 px-3 sm:px-4", children: [errorMessage && (_jsx(Alert, { variant: "error", className: "mb-4", children: errorMessage })), _jsx(DataTable, { columns: PRIZE_DRAW_COLUMNS, rows: rows, isLoading: isLoading, emptyLabel: "No prize draws listed yet", getRowHref: (row) => String(ROUTES.STORE.PRIZE_DRAWS_EDIT(row.id)), renderRowActions: (row) => (_jsx(RowActionMenu, { actions: [
150
- {
151
- label: ACTIONS.STORE["edit-listing"].label,
152
- onClick: () => void dispatch({ type: "NAVIGATE", href: String(ROUTES.STORE.PRIZE_DRAWS_EDIT(row.id)) }),
153
- },
154
- ...(onDelete ? [{
155
- label: ACTIONS.STORE["delete-listing"].label,
156
- destructive: true,
157
- onClick: () => setDeleteTargetId(row.id),
158
- disabled: deletingId === row.id,
159
- }] : []),
160
- ] })) })] }), _jsx(ListingFilterDrawer, { open: filterOpen, onClose: () => setFilterOpen(false), onApply: applyFilters, onClear: clearFilters, activeCount: activeFilterCount, children: _jsx(FilterChipGroup, { label: "Status", tabs: STATUS_OPTIONS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) }) }), deleteTargetId && (_jsx(ConfirmDeleteModal, { isOpen: true, title: "Delete Prize Draw", message: "Are you sure you want to delete this prize draw listing? This cannot be undone.", onConfirm: () => handleDelete(deleteTargetId), onClose: () => setDeleteTargetId(null), isDeleting: deletingId === deleteTargetId }))] }));
104
+ buildFilters: (state) => {
105
+ const status = state.status && state.status !== "All" ? `status==${state.status}` : null;
106
+ return ["listingType==prize-draw", status].filter(Boolean).join(",");
107
+ },
108
+ getRowHref: (row) => String(ROUTES.STORE.PRIZE_DRAWS_EDIT(row.id)),
109
+ renderRowActions: (row) => (_jsx(RowActionMenu, { actions: [
110
+ {
111
+ label: ACTIONS.STORE["edit-listing"].label,
112
+ onClick: () => void dispatch({ type: "NAVIGATE", href: String(ROUTES.STORE.PRIZE_DRAWS_EDIT(row.id)) }),
113
+ },
114
+ ...(onDelete
115
+ ? [
116
+ {
117
+ label: ACTIONS.STORE["delete-listing"].label,
118
+ destructive: true,
119
+ onClick: () => setDeleteTargetId(row.id),
120
+ disabled: deletingId === row.id,
121
+ },
122
+ ]
123
+ : []),
124
+ ] })),
125
+ renderFilterPanel: ({ pendingFilters, setPendingFilters }) => (_jsx(FilterChipGroup, { label: "Status", tabs: SELLER_PRIZE_DRAW_STATUS_TABS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) })),
126
+ };
127
+ return (_jsxs(_Fragment, { children: [_jsx(DataListingView, { config: config }), deleteTargetId && (_jsx(ConfirmDeleteModal, { isOpen: true, title: "Delete Prize Draw", message: "Are you sure you want to delete this prize draw listing? This cannot be undone.", onConfirm: () => handleDelete(deleteTargetId), onClose: () => setDeleteTargetId(null), isDeleting: deletingId === deleteTargetId }))] }));
161
128
  }
@@ -70,7 +70,7 @@ export interface SellerProductShellProps {
70
70
  onDiscard?: () => void;
71
71
  isLoading?: boolean;
72
72
  storeSlug?: string;
73
- /** Render a custom category selector (e.g. InlineCreateSelect). */
73
+ /** Render a custom category selector (e.g. PaginatedSelect with createLabel). */
74
74
  renderCategorySelector?: (props: {
75
75
  value: string;
76
76
  onChange: (v: string) => void;
@@ -1,5 +1,5 @@
1
- import type { ListingViewShellProps } from "../../../ui";
2
- export interface SellerProductsViewProps extends ListingViewShellProps {
1
+ import type { ListingLayoutProps } from "../../../ui";
2
+ export interface SellerProductsViewProps extends ListingLayoutProps {
3
3
  onDeleteProduct?: (id: string) => Promise<void>;
4
4
  /** S-STORE-2-E — "New Listing" toolbar button. */
5
5
  onCreateClick?: () => void;
@@ -7,7 +7,7 @@ import { Eye, EyeOff, Pencil, Trash2, Printer, MapPin } from "lucide-react";
7
7
  import { PhysicalLocationModal } from "./PhysicalLocationModal";
8
8
  import { useUrlTable } from "../../../react/hooks/useUrlTable";
9
9
  import { useBulkSelection } from "../../../react/hooks/useBulkSelection";
10
- import { Alert, Badge, BulkActionBar, Button, Div, ListingToolbar, ListingViewShell, Pagination, Row, Span, Text, useToast } from "../../../ui";
10
+ import { Alert, Badge, BulkActionBar, Button, Div, ListingToolbar, ListingLayout, Pagination, Row, Span, Text, useToast } from "../../../ui";
11
11
  import { SELLER_ENDPOINTS } from "../../../constants/api-endpoints";
12
12
  import { SELLER_PRODUCT_STATUS_TABS } from "../../admin/constants/filter-tabs";
13
13
  import { ROUTES } from "../../../constants";
@@ -16,6 +16,7 @@ import { toRecordArray, toRelativeDate, toStringValue, useSellerListingData, } f
16
16
  import { DataTable } from "../../admin/components/DataTable";
17
17
  import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
18
18
  import { buildBulkAction } from "../../../_internal/shared/actions/bulk-helpers";
19
+ import { useListingTypeFlags } from "../../../react/hooks/useListingTypeFlags";
19
20
  import { SellerProductsCards } from "./SellerProductsCards";
20
21
  import { SellerProductsFilterDrawer } from "./SellerProductsFilterDrawer";
21
22
  import { KIND_BADGE_VARIANT } from "./seller-products-styles";
@@ -44,17 +45,21 @@ const STATUS_OPTIONS = SELLER_PRODUCT_STATUS_TABS;
44
45
  // S-STORE-2-A — `<TypeDropdown>` replaces the legacy chip strip. Same width on
45
46
  // mobile, narrower on desktop. Drives the `?listingType=` query param.
46
47
  function TypeDropdown({ active, onChange, }) {
48
+ const flags = useListingTypeFlags();
49
+ // W1-43 — hide disabled types so the seller can't filter for an
50
+ // inactive listing surface. Bundle is a categoryType (not a listingType)
51
+ // and stays unconditionally available.
47
52
  const options = [
48
53
  { value: "all", label: "All listings" },
49
- { value: "standard", label: "Standard" },
50
- { value: "auction", label: "Auction" },
51
- { value: "pre-order", label: "Pre-order" },
52
- { value: "prize-draw", label: "Prize Draw" },
54
+ flags.standard && { value: "standard", label: "Standard" },
55
+ flags.auction && { value: "auction", label: "Auction" },
56
+ flags["pre-order"] && { value: "pre-order", label: "Pre-order" },
57
+ flags["prize-draw"] && { value: "prize-draw", label: "Prize Draw" },
53
58
  { value: "bundle", label: "Bundle" },
54
- { value: "classified", label: "Classified" },
55
- { value: "digital-code", label: "Digital Code" },
56
- { value: "live", label: "Live" },
57
- ];
59
+ flags.classified && { value: "classified", label: "Classified" },
60
+ flags["digital-code"] && { value: "digital-code", label: "Digital Code" },
61
+ flags.live && { value: "live", label: "Live" },
62
+ ].filter(Boolean);
58
63
  return (_jsxs(Row, { className: "gap-2 px-3 lg:px-4 py-2 border-b border-[var(--appkit-color-border)]", children: [_jsx(Text, { className: "text-xs font-semibold uppercase tracking-wide text-[var(--appkit-color-text-muted)]", children: "Listing type" }), _jsx("select", { value: active, onChange: (e) => onChange(e.target.value), className: "rounded border border-[var(--appkit-color-border)] bg-transparent px-2 py-1 text-sm sm:max-w-xs", "aria-label": "Filter by listing type", children: options.map((o) => (_jsx("option", { value: o.value, children: o.label }, o.value))) })] }));
59
64
  }
60
65
  const PRODUCT_COLUMNS = [
@@ -207,7 +212,7 @@ export function SellerProductsView({ onDeleteProduct, onCreateClick, children, .
207
212
  .map((r) => statusOverrides.has(r.id) ? { ...r, status: statusOverrides.get(r.id) } : r);
208
213
  const selection = useBulkSelection({ items: visibleRows, keyExtractor: (r) => r.id });
209
214
  if (hasChildren) {
210
- return (_jsx(ListingViewShell, { portal: "seller", ...props, children: children }));
215
+ return (_jsx(ListingLayout, { portal: "seller", ...props, children: children }));
211
216
  }
212
217
  const handleEdit = (row) => {
213
218
  const href = row.listingKind === "auction"
@@ -123,7 +123,7 @@ export function SellerShippingConfigsView({ onCreateClick, onEditClick, onDelete
123
123
  window.location.href = String(ROUTES.STORE.SHIPPING_CONFIGS_EDIT(id));
124
124
  }
125
125
  }, [onEditClick]);
126
- return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: 0, searchValue: searchInput, searchPlaceholder: "Search shipping configs...", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get(TABLE_KEYS.SORT) || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => { table.set(TABLE_KEYS.SORT, v); }, onResetAll: resetAll, hasActiveState: hasActiveState, extra: _jsxs(Button, { size: "sm", onClick: handleCreate, className: "flex items-center gap-1.5", children: [_jsx(Plus, { className: "h-4 w-4" }), _jsx("span", { children: "New Config" })] }) }), _jsxs("div", { className: "py-4 px-3 sm:px-4", children: [errorMessage && (_jsx(Div, { className: "mb-4 rounded-xl border border-red-200 bg-error-surface dark:border-red-900/60 px-4 py-3 text-sm text-error", children: errorMessage })), isLoading ? (_jsx(Div, { className: "space-y-2", children: Array.from({ length: 3 }).map((_, i) => (_jsx(Div, { className: "h-14 animate-pulse rounded-xl border border-zinc-100 dark:border-slate-700 bg-zinc-50 dark:bg-slate-800" }, i))) })) : rows.length === 0 ? (_jsxs(Div, { className: "py-16 text-center", children: [_jsx(Text, { className: "text-zinc-400 dark:text-zinc-400", children: "No shipping configs yet \u2014 define your first shipping rule" }), _jsx("div", { className: "mt-4", children: _jsx(Button, { size: "sm", onClick: handleCreate, children: "Add shipping config" }) })] })) : (_jsx(DataTable, { columns: COLUMNS, data: rows, keyExtractor: (r) => r.id, actions: (row) => (_jsx(RowActionMenu, { actions: [
126
+ return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: 0, searchValue: searchInput, searchPlaceholder: "Search shipping configs...", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get(TABLE_KEYS.SORT) || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => { table.set(TABLE_KEYS.SORT, v); }, onResetAll: resetAll, hasActiveState: hasActiveState, extra: _jsxs(Button, { size: "sm", onClick: handleCreate, className: "flex items-center gap-1.5", children: [_jsx(Plus, { className: "h-4 w-4" }), _jsx("span", { children: "New Config" })] }) }), _jsxs("div", { className: "py-4 px-3 sm:px-4", children: [errorMessage && (_jsx(Div, { className: "mb-4 rounded-xl border border-error/20 bg-error-surface px-4 py-3 text-sm text-error", children: errorMessage })), isLoading ? (_jsx(Div, { className: "space-y-2", children: Array.from({ length: 3 }).map((_, i) => (_jsx(Div, { className: "h-14 animate-pulse rounded-xl border border-zinc-100 dark:border-slate-700 bg-zinc-50 dark:bg-slate-800" }, i))) })) : rows.length === 0 ? (_jsxs(Div, { className: "py-16 text-center", children: [_jsx(Text, { className: "text-zinc-400 dark:text-zinc-400", children: "No shipping configs yet \u2014 define your first shipping rule" }), _jsx("div", { className: "mt-4", children: _jsx(Button, { size: "sm", onClick: handleCreate, children: "Add shipping config" }) })] })) : (_jsx(DataTable, { columns: COLUMNS, data: rows, keyExtractor: (r) => r.id, actions: (row) => (_jsx(RowActionMenu, { actions: [
127
127
  {
128
128
  label: ACTIONS.STORE["edit-listing"].label,
129
129
  onClick: () => handleEdit(row.id),
@@ -25,8 +25,4 @@ interface StoreSidebarProps {
25
25
  className?: string;
26
26
  }
27
27
  export declare function StoreSidebar({ items, groups, activeHref, storeName, storeLogoURL, mobileOpen, desktopOpen, variant, onCloseMobile, onToggle, }: StoreSidebarProps): import("react/jsx-runtime").JSX.Element;
28
- /** @deprecated Use StoreSidebar */
29
- export declare const SellerSidebar: typeof StoreSidebar;
30
- /** @deprecated Use StoreNavItem */
31
- export type SellerNavItem = StoreNavItem;
32
28
  export {};
@@ -62,5 +62,3 @@ export function StoreSidebar({ items, groups, activeHref, storeName, storeLogoUR
62
62
  return (_jsxs(_Fragment, { children: [mounted && mobileOpen &&
63
63
  createPortal(_jsx(DrawerPanel, { title: panelTitle, onClose: close, children: navContent }), document.body), _jsx("div", { className: "md:hidden", children: _jsx(BottomSheet, { open: mobileOpen, onClose: close, title: panelTitle, children: groups ? (_jsx(GroupsContent, { groups: groups, activeHref: activeHref, storeName: storeName, storeLogoURL: storeLogoURL, onItemClick: close })) : (_jsx(FlatContent, { items: items, activeHref: activeHref, storeName: storeName, storeLogoURL: storeLogoURL, onItemClick: close })) }) })] }));
64
64
  }
65
- /** @deprecated Use StoreSidebar */
66
- export const SellerSidebar = StoreSidebar;
@@ -94,7 +94,7 @@ export function SellerStoreCategoriesView({ onCreateClick, onEditClick, onDelete
94
94
  window.location.href = String(ROUTES.STORE.STORE_CATEGORIES_NEW);
95
95
  };
96
96
  useBottomActions(selection.selectedCount > 0 ? { bulk: { selectedCount: selection.selectedCount, onClearSelection: selection.clearSelection, actions: bulkActions } } : {});
97
- return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: 0, searchValue: searchInput, searchPlaceholder: "Search categories by label...", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get(TABLE_KEYS.SORT) || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => { table.set(TABLE_KEYS.SORT, v); }, showTableView: true, view: "table", onViewChange: () => { }, onResetAll: resetAll, hasActiveState: hasActiveState, extra: _jsxs(Button, { size: "sm", onClick: handleNavigateNew, className: "flex items-center gap-1.5", children: [_jsx(Plus, { className: "h-4 w-4" }), _jsx("span", { children: "New Category" })] }) }), totalPages > 1 && (_jsx("div", { className: "sticky top-[calc(var(--header-height,0px)+44px)] z-10 flex justify-center bg-white/95 dark:bg-slate-900/95 backdrop-blur-sm border-b border-zinc-200 dark:border-slate-700 px-3 py-1.5", children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), selection.selectedCount > 0 && (_jsx(BulkActionBar, { selectedCount: selection.selectedCount, actions: bulkActions, onClearSelection: selection.clearSelection })), _jsxs("div", { className: "py-4 px-3 sm:px-4", children: [errorMessage && (_jsx(Div, { className: "mb-4 rounded-xl border border-red-200 bg-error-surface dark:border-red-900/60 px-4 py-3 text-sm text-error", children: errorMessage })), isLoading ? (_jsx(Div, { className: "space-y-2", children: Array.from({ length: 5 }).map((_, i) => (_jsx(Div, { className: "h-14 animate-pulse rounded-xl border border-zinc-100 dark:border-slate-700 bg-zinc-50 dark:bg-slate-800" }, i))) })) : rows.length === 0 ? (_jsx(Div, { className: "py-16 text-center", children: _jsx(Text, { className: "text-zinc-400 dark:text-zinc-400", children: "No categories yet \u2014 add your first storefront category" }) })) : (_jsx(DataTable, { columns: COLUMNS, data: rows, keyExtractor: (r) => r.id, selectable: bulkActions.length > 0, selectedIds: selection.selectedIds, onSelectionChange: (ids) => selection.setSelectedIds(ids), actions: (row) => (_jsx(RowActionMenu, { actions: [
97
+ return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: 0, searchValue: searchInput, searchPlaceholder: "Search categories by label...", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get(TABLE_KEYS.SORT) || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => { table.set(TABLE_KEYS.SORT, v); }, showTableView: true, view: "table", onViewChange: () => { }, onResetAll: resetAll, hasActiveState: hasActiveState, extra: _jsxs(Button, { size: "sm", onClick: handleNavigateNew, className: "flex items-center gap-1.5", children: [_jsx(Plus, { className: "h-4 w-4" }), _jsx("span", { children: "New Category" })] }) }), totalPages > 1 && (_jsx("div", { className: "sticky top-[calc(var(--header-height,0px)+44px)] z-10 flex justify-center bg-white/95 dark:bg-slate-900/95 backdrop-blur-sm border-b border-zinc-200 dark:border-slate-700 px-3 py-1.5", children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), selection.selectedCount > 0 && (_jsx(BulkActionBar, { selectedCount: selection.selectedCount, actions: bulkActions, onClearSelection: selection.clearSelection })), _jsxs("div", { className: "py-4 px-3 sm:px-4", children: [errorMessage && (_jsx(Div, { className: "mb-4 rounded-xl border border-error/20 bg-error-surface px-4 py-3 text-sm text-error", children: errorMessage })), isLoading ? (_jsx(Div, { className: "space-y-2", children: Array.from({ length: 5 }).map((_, i) => (_jsx(Div, { className: "h-14 animate-pulse rounded-xl border border-zinc-100 dark:border-slate-700 bg-zinc-50 dark:bg-slate-800" }, i))) })) : rows.length === 0 ? (_jsx(Div, { className: "py-16 text-center", children: _jsx(Text, { className: "text-zinc-400 dark:text-zinc-400", children: "No categories yet \u2014 add your first storefront category" }) })) : (_jsx(DataTable, { columns: COLUMNS, data: rows, keyExtractor: (r) => r.id, selectable: bulkActions.length > 0, selectedIds: selection.selectedIds, onSelectionChange: (ids) => selection.setSelectedIds(ids), actions: (row) => (_jsx(RowActionMenu, { actions: [
98
98
  {
99
99
  label: ACTIONS.STORE["edit-listing"].label,
100
100
  onClick: () => onEditClick