@alphabite/medusa-wishlist 0.7.1 → 0.7.2
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.
|
@@ -6,6 +6,7 @@ const reactQuery = require("@tanstack/react-query");
|
|
|
6
6
|
const Medusa = require("@medusajs/js-sdk");
|
|
7
7
|
const icons = require("@medusajs/icons");
|
|
8
8
|
const react = require("react");
|
|
9
|
+
const reactRouterDom = require("react-router-dom");
|
|
9
10
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
10
11
|
const Medusa__default = /* @__PURE__ */ _interopDefault(Medusa);
|
|
11
12
|
const sdk = new Medusa__default.default({
|
|
@@ -115,14 +116,6 @@ const WishlistAnalyticsTab = () => {
|
|
|
115
116
|
] }),
|
|
116
117
|
!hasData ? /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "text-ui-fg-subtle", children: "No wishlist activity in this period yet." }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
117
118
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3", children: [
|
|
118
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
119
|
-
KpiCard,
|
|
120
|
-
{
|
|
121
|
-
label: "Total wishlists",
|
|
122
|
-
value: String(data.kpis.total_wishlists.value),
|
|
123
|
-
delta: data.kpis.total_wishlists.delta_pct
|
|
124
|
-
}
|
|
125
|
-
),
|
|
126
119
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
127
120
|
KpiCard,
|
|
128
121
|
{
|
|
@@ -208,17 +201,24 @@ const WishlistAnalyticsTab = () => {
|
|
|
208
201
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Table.HeaderCell, { className: "text-right", children: "Items" })
|
|
209
202
|
] }) }),
|
|
210
203
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Table.Body, { children: data.top_products.map((p) => /* @__PURE__ */ jsxRuntime.jsxs(ui.Table.Row, { children: [
|
|
211
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
{
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
204
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
205
|
+
reactRouterDom.Link,
|
|
206
|
+
{
|
|
207
|
+
to: `/products/${p.product_id}`,
|
|
208
|
+
className: "flex items-center gap-2 hover:underline",
|
|
209
|
+
children: [
|
|
210
|
+
p.thumbnail ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
211
|
+
"img",
|
|
212
|
+
{
|
|
213
|
+
src: p.thumbnail,
|
|
214
|
+
alt: "",
|
|
215
|
+
className: "h-8 w-8 rounded object-cover"
|
|
216
|
+
}
|
|
217
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 w-8 rounded bg-ui-bg-subtle" }),
|
|
218
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", className: "text-ui-fg-interactive", children: p.title })
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
) }),
|
|
222
222
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, { className: "text-right", children: p.wishlist_count }),
|
|
223
223
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, { className: "text-right", children: p.item_count })
|
|
224
224
|
] }, p.product_id)) })
|
|
@@ -232,7 +232,14 @@ const WishlistAnalyticsTab = () => {
|
|
|
232
232
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Table.HeaderCell, { className: "text-right", children: "Wishlists" })
|
|
233
233
|
] }) }),
|
|
234
234
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Table.Body, { children: data.top_variants.map((v) => /* @__PURE__ */ jsxRuntime.jsxs(ui.Table.Row, { children: [
|
|
235
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
235
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
236
|
+
reactRouterDom.Link,
|
|
237
|
+
{
|
|
238
|
+
to: `/products/${v.product_id}`,
|
|
239
|
+
className: "hover:underline",
|
|
240
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", className: "text-ui-fg-interactive", children: v.title })
|
|
241
|
+
}
|
|
242
|
+
) }),
|
|
236
243
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, { className: "text-right", children: v.wishlist_count })
|
|
237
244
|
] }, v.product_variant_id)) })
|
|
238
245
|
] })
|
|
@@ -5,6 +5,7 @@ import { useQuery, useQueryClient, useMutation } from "@tanstack/react-query";
|
|
|
5
5
|
import Medusa from "@medusajs/js-sdk";
|
|
6
6
|
import { Heart } from "@medusajs/icons";
|
|
7
7
|
import { useState, useMemo, useEffect } from "react";
|
|
8
|
+
import { Link } from "react-router-dom";
|
|
8
9
|
const sdk = new Medusa({
|
|
9
10
|
baseUrl: __BACKEND_URL__ || "http://localhost:9000",
|
|
10
11
|
debug: process.env.NODE_ENV === "development",
|
|
@@ -112,14 +113,6 @@ const WishlistAnalyticsTab = () => {
|
|
|
112
113
|
] }),
|
|
113
114
|
!hasData ? /* @__PURE__ */ jsx(Text, { className: "text-ui-fg-subtle", children: "No wishlist activity in this period yet." }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
114
115
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3", children: [
|
|
115
|
-
/* @__PURE__ */ jsx(
|
|
116
|
-
KpiCard,
|
|
117
|
-
{
|
|
118
|
-
label: "Total wishlists",
|
|
119
|
-
value: String(data.kpis.total_wishlists.value),
|
|
120
|
-
delta: data.kpis.total_wishlists.delta_pct
|
|
121
|
-
}
|
|
122
|
-
),
|
|
123
116
|
/* @__PURE__ */ jsx(
|
|
124
117
|
KpiCard,
|
|
125
118
|
{
|
|
@@ -205,17 +198,24 @@ const WishlistAnalyticsTab = () => {
|
|
|
205
198
|
/* @__PURE__ */ jsx(Table.HeaderCell, { className: "text-right", children: "Items" })
|
|
206
199
|
] }) }),
|
|
207
200
|
/* @__PURE__ */ jsx(Table.Body, { children: data.top_products.map((p) => /* @__PURE__ */ jsxs(Table.Row, { children: [
|
|
208
|
-
/* @__PURE__ */ jsx(Table.Cell, { children: /* @__PURE__ */ jsxs(
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
{
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
201
|
+
/* @__PURE__ */ jsx(Table.Cell, { children: /* @__PURE__ */ jsxs(
|
|
202
|
+
Link,
|
|
203
|
+
{
|
|
204
|
+
to: `/products/${p.product_id}`,
|
|
205
|
+
className: "flex items-center gap-2 hover:underline",
|
|
206
|
+
children: [
|
|
207
|
+
p.thumbnail ? /* @__PURE__ */ jsx(
|
|
208
|
+
"img",
|
|
209
|
+
{
|
|
210
|
+
src: p.thumbnail,
|
|
211
|
+
alt: "",
|
|
212
|
+
className: "h-8 w-8 rounded object-cover"
|
|
213
|
+
}
|
|
214
|
+
) : /* @__PURE__ */ jsx("div", { className: "h-8 w-8 rounded bg-ui-bg-subtle" }),
|
|
215
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-interactive", children: p.title })
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
) }),
|
|
219
219
|
/* @__PURE__ */ jsx(Table.Cell, { className: "text-right", children: p.wishlist_count }),
|
|
220
220
|
/* @__PURE__ */ jsx(Table.Cell, { className: "text-right", children: p.item_count })
|
|
221
221
|
] }, p.product_id)) })
|
|
@@ -229,7 +229,14 @@ const WishlistAnalyticsTab = () => {
|
|
|
229
229
|
/* @__PURE__ */ jsx(Table.HeaderCell, { className: "text-right", children: "Wishlists" })
|
|
230
230
|
] }) }),
|
|
231
231
|
/* @__PURE__ */ jsx(Table.Body, { children: data.top_variants.map((v) => /* @__PURE__ */ jsxs(Table.Row, { children: [
|
|
232
|
-
/* @__PURE__ */ jsx(Table.Cell, { children: /* @__PURE__ */ jsx(
|
|
232
|
+
/* @__PURE__ */ jsx(Table.Cell, { children: /* @__PURE__ */ jsx(
|
|
233
|
+
Link,
|
|
234
|
+
{
|
|
235
|
+
to: `/products/${v.product_id}`,
|
|
236
|
+
className: "hover:underline",
|
|
237
|
+
children: /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-interactive", children: v.title })
|
|
238
|
+
}
|
|
239
|
+
) }),
|
|
233
240
|
/* @__PURE__ */ jsx(Table.Cell, { className: "text-right", children: v.wishlist_count })
|
|
234
241
|
] }, v.product_variant_id)) })
|
|
235
242
|
] })
|