@mohasinac/appkit 2.7.7 → 2.7.8
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/configs/next.js +15 -6
- package/dist/features/admin/components/AdminFeaturesView.js +0 -2
- package/dist/features/admin/components/AdminPrizeDrawsView.js +0 -1
- package/dist/features/admin/components/AdminScammersView.js +0 -1
- package/dist/features/admin/components/AdminSublistingCategoriesView.js +0 -1
- package/dist/features/admin/components/AdminSupportTicketsView.js +0 -1
- package/dist/features/admin/components/AdminTeamView.js +0 -1
- package/dist/features/blog/components/BlogIndexListing.js +0 -1
- package/dist/features/categories/components/CategoriesIndexListing.js +0 -3
- package/dist/features/events/components/EventsIndexListing.js +0 -1
- package/dist/features/pre-orders/components/PreOrdersIndexListing.js +0 -1
- package/dist/features/products/components/AuctionsIndexListing.js +0 -1
- package/dist/features/products/components/PrizeDrawsIndexListing.js +0 -2
- package/dist/features/products/components/ProductsIndexListing.js +0 -1
- package/dist/features/promotions/components/CouponsIndexListing.js +1 -5
- package/dist/features/reviews/components/ReviewsIndexListing.js +0 -1
- package/dist/features/stores/components/StoresIndexListing.js +0 -1
- package/package.json +1 -1
package/dist/configs/next.js
CHANGED
|
@@ -108,14 +108,23 @@ export function defineNextConfig(override = {}) {
|
|
|
108
108
|
"./node_modules/duplexify/**",
|
|
109
109
|
"./node_modules/uuid/**",
|
|
110
110
|
"./node_modules/lodash.camelcase/**",
|
|
111
|
-
//
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
"./node_modules/@
|
|
111
|
+
// @firebase/* packages that firebase-admin depends on at runtime (RTDB compat layer).
|
|
112
|
+
// Do NOT use @firebase/** — the full client SDK is hundreds of MB and times out the build.
|
|
113
|
+
"./node_modules/@firebase/database/**",
|
|
114
|
+
"./node_modules/@firebase/database-compat/**",
|
|
115
|
+
"./node_modules/@firebase/database-types/**",
|
|
116
|
+
"./node_modules/@firebase/logger/**",
|
|
117
|
+
"./node_modules/@firebase/util/**",
|
|
118
|
+
"./node_modules/@firebase/component/**",
|
|
119
|
+
"./node_modules/@firebase/app-check-interop-types/**",
|
|
120
|
+
"./node_modules/@firebase/auth-interop-types/**",
|
|
121
|
+
"./node_modules/@firebase/app-types/**",
|
|
122
|
+
// OpenTelemetry API (used by google-gax for tracing — api package only, no deps)
|
|
123
|
+
"./node_modules/@opentelemetry/api/**",
|
|
115
124
|
// @fastify/busboy (multipart — used by firebase-admin storage)
|
|
116
|
-
"./node_modules/@fastify/**",
|
|
125
|
+
"./node_modules/@fastify/busboy/**",
|
|
117
126
|
// @nodable/entities (XML entity encoding in fast-xml-parser)
|
|
118
|
-
"./node_modules/@nodable/**",
|
|
127
|
+
"./node_modules/@nodable/entities/**",
|
|
119
128
|
// Transitive deps of gaxios / duplexify / abort-controller / retry-request
|
|
120
129
|
// not statically analysed by the Vercel output file tracer (dynamic requires).
|
|
121
130
|
// Generated by full recursive dep scan (2026-05-14).
|
|
@@ -87,9 +87,7 @@ export function AdminFeaturesView({ children, ...props }) {
|
|
|
87
87
|
const tabClass = (value) => `${TAB_BASE_CLASS} ${scopeFilter === value ? TAB_ACTIVE_CLASS : TAB_INACTIVE_CLASS}`;
|
|
88
88
|
return (_jsxs(Div, { className: "min-h-screen", children: [_jsx(ListingToolbar, { searchValue: searchInput, searchPlaceholder: "Search features by label", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => {
|
|
89
89
|
table.set("sort", v);
|
|
90
|
-
table.setPage(1);
|
|
91
90
|
}, hideViewToggle: true, onResetAll: resetAll, hasActiveState: hasActiveState, extra: _jsxs(Button, { size: "sm", onClick: openCreatePanel, className: "flex items-center gap-1.5", children: [_jsx(Plus, { className: "h-4 w-4" }), "Add Feature"] }) }), _jsx(Row, { className: STICKY_TABS_CLASS, gap: "xs", children: PRODUCT_FEATURE_SCOPE_TABS.map((tab) => (_jsx("button", { type: "button", onClick: () => {
|
|
92
91
|
table.set("scope", tab.value);
|
|
93
|
-
table.setPage(1);
|
|
94
92
|
}, className: tabClass(tab.value), children: tab.label }, tab.value))) }), totalPages > 1 && (_jsx(Div, { className: PAGINATION_BAR_CLASS, 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(Text, { as: "div", className: ERROR_BANNER_CLASS, children: errorMessage })), _jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No features found", onRowClick: (row) => openEditPanel(row.id) })] }), _jsx(SideDrawer, { isOpen: isCreateOpen || isEditOpen, onClose: closePanel, title: isCreateOpen ? "Add Feature" : "Edit Feature", mode: isCreateOpen ? "create" : "edit", children: (isCreateOpen || isEditOpen) && (_jsx(AdminFeatureEditorView, { featureId: editId ?? undefined, onSaved: closePanel, onDeleted: closePanel, embedded: true })) })] }));
|
|
95
93
|
}
|
|
@@ -130,6 +130,5 @@ export function AdminPrizeDrawsView({ children, ...props }) {
|
|
|
130
130
|
}
|
|
131
131
|
return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search prize draws by name or store\u2026", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => {
|
|
132
132
|
table.set("sort", v);
|
|
133
|
-
table.setPage(1);
|
|
134
133
|
}, hideViewToggle: true, 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 found", getRowHref: (row) => String(ROUTES.ADMIN.PRIZE_DRAWS_EDIT(row.id)), renderRowActions: (row) => (_jsx(Button, { variant: "ghost", size: "sm", asChild: true, children: _jsx("a", { href: String(ROUTES.ADMIN.PRIZE_DRAWS_EDIT(row.id)), "aria-label": "Edit", children: _jsx(Pencil, { className: "w-4 h-4" }) }) })) })] }), filterOpen && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40", "aria-hidden": "true", onClick: () => setFilterOpen(false) }), _jsxs("div", { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-[var(--appkit-color-surface)] shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-[var(--appkit-color-border)] px-4 py-3.5", children: [_jsx("span", { className: "text-base font-semibold text-[var(--appkit-color-text)]", children: "Filters" }), _jsxs("div", { className: "flex items-center gap-2", children: [activeFilterCount > 0 && (_jsx("button", { type: "button", onClick: clearFilters, className: "text-xs text-[var(--appkit-color-text-muted)] hover:text-[var(--appkit-color-error)] transition-colors", children: "Clear all" })), _jsx("button", { type: "button", onClick: () => setFilterOpen(false), "aria-label": "Close", className: "rounded-lg p-1.5 text-[var(--appkit-color-text-muted)] hover:bg-[var(--appkit-color-border-subtle)] transition-colors", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsx("div", { className: "flex-1 overflow-y-auto px-4 py-4 space-y-5", children: _jsx(FilterChipGroup, { label: "Status", tabs: STATUS_OPTIONS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) }) }), _jsx("div", { className: "border-t border-[var(--appkit-color-border)] px-4 py-3.5", children: _jsxs("button", { type: "button", onClick: applyFilters, className: "w-full rounded-lg bg-[var(--appkit-color-primary)] py-2.5 text-sm font-semibold text-white hover:opacity-90 transition-opacity active:scale-[0.98]", children: ["Apply Filters", activeFilterCount > 0 ? ` (${activeFilterCount})` : ""] }) })] })] }))] }));
|
|
135
134
|
}
|
|
@@ -104,7 +104,6 @@ export function AdminScammersView({ children, ...props }) {
|
|
|
104
104
|
}
|
|
105
105
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search by name, phone, UPI ID", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => {
|
|
106
106
|
table.set("sort", v);
|
|
107
|
-
table.setPage(1);
|
|
108
107
|
}, hideViewToggle: true, 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-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-200", children: errorMessage })), _jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No scammer profiles found", renderRowActions: (row) => (_jsx(RowActionMenu, { actions: [
|
|
109
108
|
{
|
|
110
109
|
label: "Review",
|
|
@@ -51,6 +51,5 @@ export function AdminSublistingCategoriesView() {
|
|
|
51
51
|
const totalPages = Math.ceil(total / PAGE_SIZE);
|
|
52
52
|
return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { searchValue: searchInput, searchPlaceholder: "Search sub-listing categories\u2026", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => {
|
|
53
53
|
table.set("sort", v);
|
|
54
|
-
table.setPage(1);
|
|
55
54
|
}, hideViewToggle: true, 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-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-200", children: errorMessage })), _jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No sub-listing categories found" })] })] }));
|
|
56
55
|
}
|
|
@@ -111,7 +111,6 @@ export function AdminSupportTicketsView({ children, ...props }) {
|
|
|
111
111
|
}
|
|
112
112
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search by subject", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => {
|
|
113
113
|
table.set("sort", v);
|
|
114
|
-
table.setPage(1);
|
|
115
114
|
}, hideViewToggle: true, 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-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-200", children: errorMessage })), _jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No support tickets found", renderRowActions: (row) => (_jsx(RowActionMenu, { actions: [
|
|
116
115
|
{
|
|
117
116
|
label: "View",
|
|
@@ -127,7 +127,6 @@ export function AdminTeamView({ children, ...props }) {
|
|
|
127
127
|
}
|
|
128
128
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search by name or email", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => {
|
|
129
129
|
table.set("sort", v);
|
|
130
|
-
table.setPage(1);
|
|
131
130
|
}, hideViewToggle: true, onResetAll: resetAll, hasActiveState: hasActiveState, extra: _jsxs(Button, { type: "button", variant: "primary", onClick: openInvite, className: "flex items-center gap-1.5 whitespace-nowrap", children: [_jsx(UserPlus, { className: "h-4 w-4" }), "Invite Employee"] }) }), 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-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-200", children: errorMessage })), _jsx(DataTable, { rows: rows, isLoading: isLoading, emptyLabel: "No employees found", renderRowActions: (row) => (_jsx(RowActionMenu, { actions: [
|
|
132
131
|
{
|
|
133
132
|
label: "Edit Permissions",
|
|
@@ -77,7 +77,6 @@ export function BlogIndexListing({ initialData }) {
|
|
|
77
77
|
const currentPage = table.getNumber("page", 1);
|
|
78
78
|
const commitSearch = useCallback(() => {
|
|
79
79
|
table.set("q", searchInput.trim());
|
|
80
|
-
table.setPage(1);
|
|
81
80
|
}, [searchInput, table]);
|
|
82
81
|
return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search posts...", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || "-publishedAt", sortOptions: BLOG_PUBLIC_SORT_OPTIONS, onSortChange: (v) => { table.set("sort", v); }, hideViewToggle: true, 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) }) })), _jsx("div", { className: "py-6", children: isLoading ? (_jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6", children: Array.from({ length: 6 }).map((_, i) => (_jsxs("div", { className: "rounded-xl border border-zinc-100 dark:border-slate-700 overflow-hidden animate-pulse", children: [_jsx("div", { className: "aspect-video bg-zinc-200 dark:bg-slate-700" }), _jsxs("div", { className: "p-5 space-y-2", children: [_jsx("div", { className: "h-3 bg-zinc-200 dark:bg-slate-700 rounded w-1/4" }), _jsx("div", { className: "h-4 bg-zinc-200 dark:bg-slate-700 rounded w-3/4" }), _jsx("div", { className: "h-3 bg-zinc-200 dark:bg-slate-700 rounded w-full" }), _jsx("div", { className: "h-3 bg-zinc-200 dark:bg-slate-700 rounded w-2/3" })] })] }, i))) })) : posts.length === 0 ? (_jsx("p", { className: "py-12 text-center text-sm text-zinc-500 dark:text-zinc-400", children: "No posts found." })) : (_jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6", children: posts.map((post) => (_jsx(BlogCard, { post: post, href: String(ROUTES.BLOG.ARTICLE(post.slug)) }, post.id))) })) }), filterOpen && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40", "aria-hidden": "true", onClick: () => setFilterOpen(false) }), _jsxs("div", { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-white dark:bg-slate-900 shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: [_jsx("span", { className: "flex items-center gap-2 text-base font-semibold text-zinc-900 dark:text-zinc-100", children: "Filters" }), _jsxs("div", { className: "flex items-center gap-2", children: [activeFilterCount > 0 && (_jsx("button", { type: "button", onClick: clearFilters, className: "text-xs text-zinc-500 hover:text-rose-500 dark:text-zinc-400 transition-colors", children: "Clear all" })), _jsx("button", { type: "button", onClick: () => setFilterOpen(false), "aria-label": "Close filters", className: "rounded-lg p-1.5 text-zinc-500 hover:bg-zinc-100 dark:hover:bg-slate-800 transition-colors", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsx("div", { className: "flex-1 overflow-y-auto px-4 py-4", children: _jsx(BlogFilters, { table: pendingTable, variant: "public" }) }), _jsx("div", { className: "border-t border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: _jsxs("button", { type: "button", onClick: applyFilters, className: "w-full rounded-lg bg-primary py-2.5 text-sm font-semibold text-white hover:bg-primary-600 transition-colors active:scale-[0.98]", children: ["Apply Filters", activeFilterCount > 0 ? ` (${activeFilterCount})` : ""] }) })] })] }))] }));
|
|
83
82
|
}
|
|
@@ -75,12 +75,10 @@ export function CategoriesIndexListing({ initialData: _, brandsOnly = false }) {
|
|
|
75
75
|
activeFilterCount > 0;
|
|
76
76
|
const commitSearch = useCallback(() => {
|
|
77
77
|
table.set("q", searchInput.trim());
|
|
78
|
-
table.setPage(1);
|
|
79
78
|
}, [searchInput, table]);
|
|
80
79
|
const clearSearch = () => {
|
|
81
80
|
setSearchInput("");
|
|
82
81
|
table.set("q", "");
|
|
83
|
-
table.setPage(1);
|
|
84
82
|
};
|
|
85
83
|
// Tab state — "all" | "categories" | "brands" (not used when brandsOnly=true)
|
|
86
84
|
const activeTab = brandsOnly ? "brands" : (table.get("tab") || "all");
|
|
@@ -90,7 +88,6 @@ export function CategoriesIndexListing({ initialData: _, brandsOnly = false }) {
|
|
|
90
88
|
undefined;
|
|
91
89
|
const switchTab = (key) => {
|
|
92
90
|
table.set("tab", key);
|
|
93
|
-
table.setPage(1);
|
|
94
91
|
};
|
|
95
92
|
const { categories, total, totalPages, isLoading } = useCategoriesFiltered({
|
|
96
93
|
q: table.get("q") || undefined,
|
|
@@ -100,7 +100,6 @@ export function EventsIndexListing({ initialData }) {
|
|
|
100
100
|
const currentPage = table.getNumber("page", 1);
|
|
101
101
|
const commitSearch = useCallback(() => {
|
|
102
102
|
table.set("q", searchInput.trim());
|
|
103
|
-
table.setPage(1);
|
|
104
103
|
}, [searchInput, table]);
|
|
105
104
|
return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search events...", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || "startsAt", sortOptions: EVENT_PUBLIC_SORT_OPTIONS, onSortChange: (v) => { table.set("sort", v); }, hideViewToggle: true, 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) }) })), _jsx("div", { className: "py-6", children: isLoading ? (_jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6", children: Array.from({ length: 6 }).map((_, i) => (_jsxs("div", { className: "rounded-xl border border-zinc-100 dark:border-slate-700 overflow-hidden animate-pulse", children: [_jsx("div", { className: "aspect-video bg-zinc-200 dark:bg-slate-700" }), _jsxs("div", { className: "p-4 space-y-2", children: [_jsx("div", { className: "h-4 bg-zinc-200 dark:bg-slate-700 rounded w-3/4" }), _jsx("div", { className: "h-3 bg-zinc-200 dark:bg-slate-700 rounded w-full" }), _jsx("div", { className: "h-3 bg-zinc-200 dark:bg-slate-700 rounded w-2/3" }), _jsx("div", { className: "h-8 bg-zinc-200 dark:bg-slate-700 rounded mt-2" })] })] }, i))) })) : events.length === 0 ? (_jsx("p", { className: "py-12 text-center text-sm text-zinc-500 dark:text-zinc-400", children: "No events found." })) : (_jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6", children: events.map((event) => (_jsx(EventCard, { event: event }, event.id))) })) }), filterOpen && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40", "aria-hidden": "true", onClick: () => setFilterOpen(false) }), _jsxs("div", { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-white dark:bg-slate-900 shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: [_jsx("span", { className: "flex items-center gap-2 text-base font-semibold text-zinc-900 dark:text-zinc-100", children: "Filters" }), _jsxs("div", { className: "flex items-center gap-2", children: [activeFilterCount > 0 && (_jsx("button", { type: "button", onClick: clearFilters, className: "text-xs text-zinc-500 hover:text-rose-500 dark:text-zinc-400 transition-colors", children: "Clear all" })), _jsx("button", { type: "button", onClick: () => setFilterOpen(false), "aria-label": "Close filters", className: "rounded-lg p-1.5 text-zinc-500 hover:bg-zinc-100 dark:hover:bg-slate-800 transition-colors", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsx("div", { className: "flex-1 overflow-y-auto px-4 py-4", children: _jsx(EventFilters, { table: pendingTable, variant: "public" }) }), _jsx("div", { className: "border-t border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: _jsxs("button", { type: "button", onClick: applyFilters, className: "w-full rounded-lg bg-primary py-2.5 text-sm font-semibold text-white hover:bg-primary-600 transition-colors active:scale-[0.98]", children: ["Apply Filters", activeFilterCount > 0 ? ` (${activeFilterCount})` : ""] }) })] })] }))] }));
|
|
106
105
|
}
|
|
@@ -112,7 +112,6 @@ export function PreOrdersIndexListing({ initialData, categorySlug, brandName })
|
|
|
112
112
|
const { products: preOrders, totalPages, page, isLoading } = useProducts(params, { initialData });
|
|
113
113
|
const commitSearch = useCallback(() => {
|
|
114
114
|
table.set("q", searchInput.trim());
|
|
115
|
-
table.setPage(1);
|
|
116
115
|
}, [searchInput, table]);
|
|
117
116
|
const handleSearchKeyDown = (e) => {
|
|
118
117
|
if (e.key === "Enter")
|
|
@@ -107,7 +107,6 @@ export function AuctionsIndexListing({ initialData, categorySlug, brandName }) {
|
|
|
107
107
|
const { products: auctions, totalPages, page, isLoading } = useProducts(params, { initialData });
|
|
108
108
|
const commitSearch = useCallback(() => {
|
|
109
109
|
table.set("q", searchInput.trim());
|
|
110
|
-
table.setPage(1);
|
|
111
110
|
}, [searchInput, table]);
|
|
112
111
|
const handleSearchKeyDown = (e) => {
|
|
113
112
|
if (e.key === "Enter")
|
|
@@ -108,7 +108,6 @@ export function PrizeDrawsIndexListing({ initialData, categorySlug, brandName, s
|
|
|
108
108
|
: draws;
|
|
109
109
|
const commitSearch = useCallback(() => {
|
|
110
110
|
table.set("q", searchInput.trim());
|
|
111
|
-
table.setPage(1);
|
|
112
111
|
}, [searchInput, table]);
|
|
113
112
|
const handleSearchKeyDown = (e) => {
|
|
114
113
|
if (e.key === "Enter")
|
|
@@ -117,7 +116,6 @@ export function PrizeDrawsIndexListing({ initialData, categorySlug, brandName, s
|
|
|
117
116
|
const gridClass = "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4";
|
|
118
117
|
return (_jsxs("div", { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search prize draws...", onSearchChange: setSearchInput, onSearchCommit: commitSearch, onSearchKeyDown: handleSearchKeyDown, sortValue: table.get("sort") || "-createdAt", sortOptions: PRIZE_DRAW_SORT_OPTIONS, onSortChange: (v) => {
|
|
119
118
|
table.set("sort", v);
|
|
120
|
-
table.setPage(1);
|
|
121
119
|
}, view: view, onViewChange: (v) => {
|
|
122
120
|
setView(v);
|
|
123
121
|
table.set("view", v);
|
|
@@ -103,7 +103,6 @@ export function ProductsIndexListing({ initialData }) {
|
|
|
103
103
|
const selection = useBulkSelection({ items: products, keyExtractor: (p) => p.id });
|
|
104
104
|
const commitSearch = useCallback(() => {
|
|
105
105
|
table.set("q", searchInput.trim());
|
|
106
|
-
table.setPage(1);
|
|
107
106
|
}, [searchInput, table]);
|
|
108
107
|
const handleSearchKeyDown = (e) => {
|
|
109
108
|
if (e.key === "Enter")
|
|
@@ -53,7 +53,6 @@ export function CouponsIndexListing({ initialCoupons, storeSlug, storeId, }) {
|
|
|
53
53
|
: coupons;
|
|
54
54
|
const commitSearch = useCallback(() => {
|
|
55
55
|
table.set("q", searchInput.trim());
|
|
56
|
-
table.setPage(1);
|
|
57
56
|
}, [searchInput, table]);
|
|
58
57
|
const handleKeyDown = (e) => {
|
|
59
58
|
if (e.key === "Enter")
|
|
@@ -62,10 +61,7 @@ export function CouponsIndexListing({ initialCoupons, storeSlug, storeId, }) {
|
|
|
62
61
|
const activeType = table.get("type");
|
|
63
62
|
const hasActiveFilters = !!activeType || !!table.get("dateFrom") || !!table.get("dateTo");
|
|
64
63
|
const clearFilters = () => {
|
|
65
|
-
table.
|
|
66
|
-
table.set("dateFrom", "");
|
|
67
|
-
table.set("dateTo", "");
|
|
68
|
-
table.setPage(1);
|
|
64
|
+
table.setMany({ type: "", dateFrom: "", dateTo: "" });
|
|
69
65
|
};
|
|
70
66
|
return (_jsxs("div", { className: "min-h-[40vh]", children: [_jsxs("div", { className: "sticky top-[var(--header-height,0px)] z-20 border-b border-zinc-200 dark:border-slate-700 bg-white/95 dark:bg-slate-900/95 backdrop-blur-sm py-2.5 px-4", children: [_jsxs("div", { className: "flex items-center gap-2.5 max-w-full", children: [_jsxs("button", { type: "button", onClick: () => setFilterOpen(true), className: `flex shrink-0 items-center gap-2 rounded-lg border px-3.5 py-2 text-sm font-medium transition-colors ${hasActiveFilters
|
|
71
67
|
? "border-primary bg-primary-50 text-primary-700 dark:bg-primary-900/30 dark:text-primary-300"
|
|
@@ -69,7 +69,6 @@ export function ReviewsIndexListing({ initialData, variant = "public", }) {
|
|
|
69
69
|
activeFilterCount > 0;
|
|
70
70
|
const commitSearch = useCallback(() => {
|
|
71
71
|
table.set("q", searchInput.trim());
|
|
72
|
-
table.setPage(1);
|
|
73
72
|
}, [searchInput, table]);
|
|
74
73
|
const { reviews, total, totalPages, isLoading } = useReviews({
|
|
75
74
|
q: table.get("q") || undefined,
|
|
@@ -74,7 +74,6 @@ export function StoresIndexListing({ initialData }) {
|
|
|
74
74
|
activeFilterCount > 0;
|
|
75
75
|
const commitSearch = useCallback(() => {
|
|
76
76
|
table.set("q", searchInput.trim());
|
|
77
|
-
table.setPage(1);
|
|
78
77
|
}, [searchInput, table]);
|
|
79
78
|
// Build sieve filters from applied URL params
|
|
80
79
|
const ratingRaw = table.get("rating");
|