medusa-analytics 0.0.21 → 0.0.22

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.
@@ -2637,7 +2637,7 @@ function EmptyAnalyticsPanel({ title, description }) {
2637
2637
  ] });
2638
2638
  }
2639
2639
  function ProductsDashboard() {
2640
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
2640
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
2641
2641
  const [summaryDays, setSummaryDays] = react.useState("all");
2642
2642
  const [graphPeriod, setGraphPeriod] = react.useState("one_week");
2643
2643
  const [topSellerPeriod, setTopSellerPeriod] = react.useState("week");
@@ -2764,7 +2764,7 @@ function ProductsDashboard() {
2764
2764
  };
2765
2765
  }, [salesChannelId, topSellerPeriod]);
2766
2766
  react.useEffect(() => {
2767
- var _a2, _b2;
2767
+ var _a2;
2768
2768
  let cancelled = false;
2769
2769
  if (topSellersLoading) {
2770
2770
  setBestSellersTrendLoading(true);
@@ -2780,7 +2780,12 @@ function ProductsDashboard() {
2780
2780
  cancelled = true;
2781
2781
  };
2782
2782
  }
2783
- const topProductId = (_b2 = (_a2 = topSellers == null ? void 0 : topSellers.products) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.product_id;
2783
+ const topSellersByUnits2 = [...(topSellers == null ? void 0 : topSellers.products) ?? []].sort((a, b) => {
2784
+ if (b.units_sold !== a.units_sold) return b.units_sold - a.units_sold;
2785
+ if (b.order_count !== a.order_count) return b.order_count - a.order_count;
2786
+ return b.revenue - a.revenue;
2787
+ });
2788
+ const topProductId = (_a2 = topSellersByUnits2[0]) == null ? void 0 : _a2.product_id;
2784
2789
  if (!topProductId) {
2785
2790
  setBestSellersTrendLoading(false);
2786
2791
  setBestSellersTrendError(null);
@@ -2926,16 +2931,24 @@ function ProductsDashboard() {
2926
2931
  }, [series]);
2927
2932
  const peakRevenuePoint = series.length > 0 ? series.reduce((peak, point) => point.revenue > peak.revenue ? point : peak) : null;
2928
2933
  const viewsConnectedForPulse = ((summary == null ? void 0 : summary.productViewsConnected) ?? false) || (overTime == null ? void 0 : overTime.productViewsConnected) === true || (topSellers == null ? void 0 : topSellers.productViewsConnected) === true || (performance == null ? void 0 : performance.productViewsConnected) === true;
2934
+ const topSellersByUnits = react.useMemo(
2935
+ () => [...(topSellers == null ? void 0 : topSellers.products) ?? []].sort((a, b) => {
2936
+ if (b.units_sold !== a.units_sold) return b.units_sold - a.units_sold;
2937
+ if (b.order_count !== a.order_count) return b.order_count - a.order_count;
2938
+ return b.revenue - a.revenue;
2939
+ }),
2940
+ [topSellers]
2941
+ );
2929
2942
  const bestSellersTrendSeries = (bestSellersTrend == null ? void 0 : bestSellersTrend.series) ?? [];
2930
2943
  const mostViewedTrendSeries = (mostViewedTrend == null ? void 0 : mostViewedTrend.series) ?? [];
2931
- const bestSellerTrendProductTitle = ((_a = bestSellersTrend == null ? void 0 : bestSellersTrend.product) == null ? void 0 : _a.product_title) ?? ((_c = (_b = topSellers == null ? void 0 : topSellers.products) == null ? void 0 : _b[0]) == null ? void 0 : _c.product_title) ?? null;
2932
- const mostViewedTrendProductTitle = ((_d = mostViewedTrend == null ? void 0 : mostViewedTrend.product) == null ? void 0 : _d.product_title) ?? ((_f = (_e = performance == null ? void 0 : performance.topViewedProducts) == null ? void 0 : _e[0]) == null ? void 0 : _f.product_title) ?? null;
2944
+ const bestSellerTrendProductTitle = ((_a = bestSellersTrend == null ? void 0 : bestSellersTrend.product) == null ? void 0 : _a.product_title) ?? ((_b = topSellersByUnits[0]) == null ? void 0 : _b.product_title) ?? null;
2945
+ const mostViewedTrendProductTitle = ((_c = mostViewedTrend == null ? void 0 : mostViewedTrend.product) == null ? void 0 : _c.product_title) ?? ((_e = (_d = performance == null ? void 0 : performance.topViewedProducts) == null ? void 0 : _d[0]) == null ? void 0 : _e.product_title) ?? null;
2933
2946
  const viewsVsUnitsScatterData = react.useMemo(
2934
2947
  () => ((performance == null ? void 0 : performance.topViewedProducts) ?? []).slice(0, 48).filter((row) => row.total_views > 0 || row.units_sold > 0),
2935
2948
  [performance]
2936
2949
  );
2937
- const selectedSummaryPeriod = ((_g = SUMMARY_PERIODS.find((p) => p.value === summaryDays)) == null ? void 0 : _g.label) ?? "All time";
2938
- const selectedGraphPeriodLabel = ((_h = GRAPH_PERIODS.find((p) => p.value === graphPeriod)) == null ? void 0 : _h.label) ?? "One week";
2950
+ const selectedSummaryPeriod = ((_f = SUMMARY_PERIODS.find((p) => p.value === summaryDays)) == null ? void 0 : _f.label) ?? "All time";
2951
+ const selectedGraphPeriodLabel = ((_g = GRAPH_PERIODS.find((p) => p.value === graphPeriod)) == null ? void 0 : _g.label) ?? "One week";
2939
2952
  const quickPulseMetrics = [
2940
2953
  {
2941
2954
  label: "Range units",
@@ -2977,7 +2990,7 @@ function ProductsDashboard() {
2977
2990
  return /* @__PURE__ */ jsxRuntime.jsx(ui.Container, { className: "p-6", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "text-ui-fg-danger", children: summaryError ?? "Failed to load product analytics" }) });
2978
2991
  }
2979
2992
  const viewsConnected = summary.productViewsConnected || (overTime == null ? void 0 : overTime.productViewsConnected) === true || (topSellers == null ? void 0 : topSellers.productViewsConnected) === true || (performance == null ? void 0 : performance.productViewsConnected) === true;
2980
- const selectedChannelLabel = salesChannelId === "all" ? "All channels" : ((_i = salesChannels.find((channel) => channel.id === salesChannelId)) == null ? void 0 : _i.name) ?? "Selected channel";
2993
+ const selectedChannelLabel = salesChannelId === "all" ? "All channels" : ((_h = salesChannels.find((channel) => channel.id === salesChannelId)) == null ? void 0 : _h.name) ?? "Selected channel";
2981
2994
  const primaryStats = [
2982
2995
  {
2983
2996
  label: "Units sold",
@@ -3398,7 +3411,7 @@ function ProductsDashboard() {
3398
3411
  variant: "atlas",
3399
3412
  actionsBare: true,
3400
3413
  title: "Best sellers",
3401
- description: bestSellerTrendProductTitle ? `Revenue and units over time for “${bestSellerTrendProductTitle}” (#1 by revenue in this window; all-time uses a 12‑month chart).` : "Revenue and units over time for the top product by revenue in this window (all-time leaderboard uses a 12‑month chart).",
3414
+ description: bestSellerTrendProductTitle ? `Revenue and units over time for “${bestSellerTrendProductTitle}” (#1 by units sold in this window; all-time uses a 12‑month chart).` : "Revenue and units over time for the top product by units sold in this window (all-time leaderboard uses a 12‑month chart).",
3402
3415
  actions: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
3403
3416
  /* @__PURE__ */ jsxRuntime.jsx(
3404
3417
  ui.Label,
@@ -3562,7 +3575,7 @@ function ProductsDashboard() {
3562
3575
  variant: "atlas",
3563
3576
  className: "min-w-0 md:col-span-1 xl:col-span-1",
3564
3577
  title: "Leaderboard table",
3565
- description: "Products ranked by revenue — same window as Best sellers.",
3578
+ description: "Products ranked by units sold — same window as Best sellers.",
3566
3579
  children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-[212px] min-w-0 sm:min-h-[228px]", children: /* @__PURE__ */ jsxRuntime.jsx(AnalyticsTableSurface, { className: "shadow-sm", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Table, { className: LEADERBOARD_TABLE_CLASS, children: [
3567
3580
  /* @__PURE__ */ jsxRuntime.jsx(ui.Table.Header, { children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Table.Row, { children: [
3568
3581
  /* @__PURE__ */ jsxRuntime.jsx(ui.Table.HeaderCell, { className: TABLE_HEAD_CELL_NOWRAP, children: "Product" }),
@@ -3577,12 +3590,12 @@ function ProductsDashboard() {
3577
3590
  /* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, {}),
3578
3591
  /* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, {})
3579
3592
  ] }) : null,
3580
- !topSellersError ? ((topSellers == null ? void 0 : topSellers.products) ?? []).slice(0, 8).map((product) => {
3581
- var _a2, _b2;
3593
+ !topSellersError ? topSellersByUnits.slice(0, 8).map((product) => {
3594
+ var _a2;
3582
3595
  return /* @__PURE__ */ jsxRuntime.jsxs(
3583
3596
  ui.Table.Row,
3584
3597
  {
3585
- className: product.product_id === ((_b2 = (_a2 = topSellers == null ? void 0 : topSellers.products) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.product_id) ? "bg-emerald-500/5" : void 0,
3598
+ className: product.product_id === ((_a2 = topSellersByUnits[0]) == null ? void 0 : _a2.product_id) ? "bg-emerald-500/5" : void 0,
3586
3599
  children: [
3587
3600
  /* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, { children: product.product_title }),
3588
3601
  /* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, { children: product.units_sold.toLocaleString() }),
@@ -3593,7 +3606,7 @@ function ProductsDashboard() {
3593
3606
  product.product_id
3594
3607
  );
3595
3608
  }) : null,
3596
- !topSellersLoading && !topSellersError && (((_j = topSellers == null ? void 0 : topSellers.products) == null ? void 0 : _j.length) ?? 0) === 0 ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Table.Row, { children: [
3609
+ !topSellersLoading && !topSellersError && (((_i = topSellers == null ? void 0 : topSellers.products) == null ? void 0 : _i.length) ?? 0) === 0 ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Table.Row, { children: [
3597
3610
  /* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "text-ui-fg-muted text-xs", children: "No best seller data yet." }) }),
3598
3611
  /* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, {}),
3599
3612
  /* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, {}),
@@ -3749,7 +3762,7 @@ function ProductsDashboard() {
3749
3762
  /* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, { children: product.units_sold.toLocaleString() }),
3750
3763
  /* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, { children: formatRatio(product.views_per_unit) })
3751
3764
  ] }, product.product_id)),
3752
- !performanceLoading && !performanceError && (((_k = performance == null ? void 0 : performance.viewOpportunities) == null ? void 0 : _k.length) ?? 0) === 0 ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Table.Row, { children: [
3765
+ !performanceLoading && !performanceError && (((_j = performance == null ? void 0 : performance.viewOpportunities) == null ? void 0 : _j.length) ?? 0) === 0 ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Table.Row, { children: [
3753
3766
  /* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "text-ui-fg-muted text-xs", children: "No product view opportunities yet." }) }),
3754
3767
  /* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, {}),
3755
3768
  /* @__PURE__ */ jsxRuntime.jsx(ui.Table.Cell, {}),
@@ -2636,7 +2636,7 @@ function EmptyAnalyticsPanel({ title, description }) {
2636
2636
  ] });
2637
2637
  }
2638
2638
  function ProductsDashboard() {
2639
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
2639
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
2640
2640
  const [summaryDays, setSummaryDays] = useState("all");
2641
2641
  const [graphPeriod, setGraphPeriod] = useState("one_week");
2642
2642
  const [topSellerPeriod, setTopSellerPeriod] = useState("week");
@@ -2763,7 +2763,7 @@ function ProductsDashboard() {
2763
2763
  };
2764
2764
  }, [salesChannelId, topSellerPeriod]);
2765
2765
  useEffect(() => {
2766
- var _a2, _b2;
2766
+ var _a2;
2767
2767
  let cancelled = false;
2768
2768
  if (topSellersLoading) {
2769
2769
  setBestSellersTrendLoading(true);
@@ -2779,7 +2779,12 @@ function ProductsDashboard() {
2779
2779
  cancelled = true;
2780
2780
  };
2781
2781
  }
2782
- const topProductId = (_b2 = (_a2 = topSellers == null ? void 0 : topSellers.products) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.product_id;
2782
+ const topSellersByUnits2 = [...(topSellers == null ? void 0 : topSellers.products) ?? []].sort((a, b) => {
2783
+ if (b.units_sold !== a.units_sold) return b.units_sold - a.units_sold;
2784
+ if (b.order_count !== a.order_count) return b.order_count - a.order_count;
2785
+ return b.revenue - a.revenue;
2786
+ });
2787
+ const topProductId = (_a2 = topSellersByUnits2[0]) == null ? void 0 : _a2.product_id;
2783
2788
  if (!topProductId) {
2784
2789
  setBestSellersTrendLoading(false);
2785
2790
  setBestSellersTrendError(null);
@@ -2925,16 +2930,24 @@ function ProductsDashboard() {
2925
2930
  }, [series]);
2926
2931
  const peakRevenuePoint = series.length > 0 ? series.reduce((peak, point) => point.revenue > peak.revenue ? point : peak) : null;
2927
2932
  const viewsConnectedForPulse = ((summary == null ? void 0 : summary.productViewsConnected) ?? false) || (overTime == null ? void 0 : overTime.productViewsConnected) === true || (topSellers == null ? void 0 : topSellers.productViewsConnected) === true || (performance == null ? void 0 : performance.productViewsConnected) === true;
2933
+ const topSellersByUnits = useMemo(
2934
+ () => [...(topSellers == null ? void 0 : topSellers.products) ?? []].sort((a, b) => {
2935
+ if (b.units_sold !== a.units_sold) return b.units_sold - a.units_sold;
2936
+ if (b.order_count !== a.order_count) return b.order_count - a.order_count;
2937
+ return b.revenue - a.revenue;
2938
+ }),
2939
+ [topSellers]
2940
+ );
2928
2941
  const bestSellersTrendSeries = (bestSellersTrend == null ? void 0 : bestSellersTrend.series) ?? [];
2929
2942
  const mostViewedTrendSeries = (mostViewedTrend == null ? void 0 : mostViewedTrend.series) ?? [];
2930
- const bestSellerTrendProductTitle = ((_a = bestSellersTrend == null ? void 0 : bestSellersTrend.product) == null ? void 0 : _a.product_title) ?? ((_c = (_b = topSellers == null ? void 0 : topSellers.products) == null ? void 0 : _b[0]) == null ? void 0 : _c.product_title) ?? null;
2931
- const mostViewedTrendProductTitle = ((_d = mostViewedTrend == null ? void 0 : mostViewedTrend.product) == null ? void 0 : _d.product_title) ?? ((_f = (_e = performance == null ? void 0 : performance.topViewedProducts) == null ? void 0 : _e[0]) == null ? void 0 : _f.product_title) ?? null;
2943
+ const bestSellerTrendProductTitle = ((_a = bestSellersTrend == null ? void 0 : bestSellersTrend.product) == null ? void 0 : _a.product_title) ?? ((_b = topSellersByUnits[0]) == null ? void 0 : _b.product_title) ?? null;
2944
+ const mostViewedTrendProductTitle = ((_c = mostViewedTrend == null ? void 0 : mostViewedTrend.product) == null ? void 0 : _c.product_title) ?? ((_e = (_d = performance == null ? void 0 : performance.topViewedProducts) == null ? void 0 : _d[0]) == null ? void 0 : _e.product_title) ?? null;
2932
2945
  const viewsVsUnitsScatterData = useMemo(
2933
2946
  () => ((performance == null ? void 0 : performance.topViewedProducts) ?? []).slice(0, 48).filter((row) => row.total_views > 0 || row.units_sold > 0),
2934
2947
  [performance]
2935
2948
  );
2936
- const selectedSummaryPeriod = ((_g = SUMMARY_PERIODS.find((p) => p.value === summaryDays)) == null ? void 0 : _g.label) ?? "All time";
2937
- const selectedGraphPeriodLabel = ((_h = GRAPH_PERIODS.find((p) => p.value === graphPeriod)) == null ? void 0 : _h.label) ?? "One week";
2949
+ const selectedSummaryPeriod = ((_f = SUMMARY_PERIODS.find((p) => p.value === summaryDays)) == null ? void 0 : _f.label) ?? "All time";
2950
+ const selectedGraphPeriodLabel = ((_g = GRAPH_PERIODS.find((p) => p.value === graphPeriod)) == null ? void 0 : _g.label) ?? "One week";
2938
2951
  const quickPulseMetrics = [
2939
2952
  {
2940
2953
  label: "Range units",
@@ -2976,7 +2989,7 @@ function ProductsDashboard() {
2976
2989
  return /* @__PURE__ */ jsx(Container, { className: "p-6", children: /* @__PURE__ */ jsx(Text, { className: "text-ui-fg-danger", children: summaryError ?? "Failed to load product analytics" }) });
2977
2990
  }
2978
2991
  const viewsConnected = summary.productViewsConnected || (overTime == null ? void 0 : overTime.productViewsConnected) === true || (topSellers == null ? void 0 : topSellers.productViewsConnected) === true || (performance == null ? void 0 : performance.productViewsConnected) === true;
2979
- const selectedChannelLabel = salesChannelId === "all" ? "All channels" : ((_i = salesChannels.find((channel) => channel.id === salesChannelId)) == null ? void 0 : _i.name) ?? "Selected channel";
2992
+ const selectedChannelLabel = salesChannelId === "all" ? "All channels" : ((_h = salesChannels.find((channel) => channel.id === salesChannelId)) == null ? void 0 : _h.name) ?? "Selected channel";
2980
2993
  const primaryStats = [
2981
2994
  {
2982
2995
  label: "Units sold",
@@ -3397,7 +3410,7 @@ function ProductsDashboard() {
3397
3410
  variant: "atlas",
3398
3411
  actionsBare: true,
3399
3412
  title: "Best sellers",
3400
- description: bestSellerTrendProductTitle ? `Revenue and units over time for “${bestSellerTrendProductTitle}” (#1 by revenue in this window; all-time uses a 12‑month chart).` : "Revenue and units over time for the top product by revenue in this window (all-time leaderboard uses a 12‑month chart).",
3413
+ description: bestSellerTrendProductTitle ? `Revenue and units over time for “${bestSellerTrendProductTitle}” (#1 by units sold in this window; all-time uses a 12‑month chart).` : "Revenue and units over time for the top product by units sold in this window (all-time leaderboard uses a 12‑month chart).",
3401
3414
  actions: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
3402
3415
  /* @__PURE__ */ jsx(
3403
3416
  Label,
@@ -3561,7 +3574,7 @@ function ProductsDashboard() {
3561
3574
  variant: "atlas",
3562
3575
  className: "min-w-0 md:col-span-1 xl:col-span-1",
3563
3576
  title: "Leaderboard table",
3564
- description: "Products ranked by revenue — same window as Best sellers.",
3577
+ description: "Products ranked by units sold — same window as Best sellers.",
3565
3578
  children: /* @__PURE__ */ jsx("div", { className: "min-h-[212px] min-w-0 sm:min-h-[228px]", children: /* @__PURE__ */ jsx(AnalyticsTableSurface, { className: "shadow-sm", children: /* @__PURE__ */ jsxs(Table, { className: LEADERBOARD_TABLE_CLASS, children: [
3566
3579
  /* @__PURE__ */ jsx(Table.Header, { children: /* @__PURE__ */ jsxs(Table.Row, { children: [
3567
3580
  /* @__PURE__ */ jsx(Table.HeaderCell, { className: TABLE_HEAD_CELL_NOWRAP, children: "Product" }),
@@ -3576,12 +3589,12 @@ function ProductsDashboard() {
3576
3589
  /* @__PURE__ */ jsx(Table.Cell, {}),
3577
3590
  /* @__PURE__ */ jsx(Table.Cell, {})
3578
3591
  ] }) : null,
3579
- !topSellersError ? ((topSellers == null ? void 0 : topSellers.products) ?? []).slice(0, 8).map((product) => {
3580
- var _a2, _b2;
3592
+ !topSellersError ? topSellersByUnits.slice(0, 8).map((product) => {
3593
+ var _a2;
3581
3594
  return /* @__PURE__ */ jsxs(
3582
3595
  Table.Row,
3583
3596
  {
3584
- className: product.product_id === ((_b2 = (_a2 = topSellers == null ? void 0 : topSellers.products) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.product_id) ? "bg-emerald-500/5" : void 0,
3597
+ className: product.product_id === ((_a2 = topSellersByUnits[0]) == null ? void 0 : _a2.product_id) ? "bg-emerald-500/5" : void 0,
3585
3598
  children: [
3586
3599
  /* @__PURE__ */ jsx(Table.Cell, { children: product.product_title }),
3587
3600
  /* @__PURE__ */ jsx(Table.Cell, { children: product.units_sold.toLocaleString() }),
@@ -3592,7 +3605,7 @@ function ProductsDashboard() {
3592
3605
  product.product_id
3593
3606
  );
3594
3607
  }) : null,
3595
- !topSellersLoading && !topSellersError && (((_j = topSellers == null ? void 0 : topSellers.products) == null ? void 0 : _j.length) ?? 0) === 0 ? /* @__PURE__ */ jsxs(Table.Row, { children: [
3608
+ !topSellersLoading && !topSellersError && (((_i = topSellers == null ? void 0 : topSellers.products) == null ? void 0 : _i.length) ?? 0) === 0 ? /* @__PURE__ */ jsxs(Table.Row, { children: [
3596
3609
  /* @__PURE__ */ jsx(Table.Cell, { children: /* @__PURE__ */ jsx(Text, { className: "text-ui-fg-muted text-xs", children: "No best seller data yet." }) }),
3597
3610
  /* @__PURE__ */ jsx(Table.Cell, {}),
3598
3611
  /* @__PURE__ */ jsx(Table.Cell, {}),
@@ -3748,7 +3761,7 @@ function ProductsDashboard() {
3748
3761
  /* @__PURE__ */ jsx(Table.Cell, { children: product.units_sold.toLocaleString() }),
3749
3762
  /* @__PURE__ */ jsx(Table.Cell, { children: formatRatio(product.views_per_unit) })
3750
3763
  ] }, product.product_id)),
3751
- !performanceLoading && !performanceError && (((_k = performance == null ? void 0 : performance.viewOpportunities) == null ? void 0 : _k.length) ?? 0) === 0 ? /* @__PURE__ */ jsxs(Table.Row, { children: [
3764
+ !performanceLoading && !performanceError && (((_j = performance == null ? void 0 : performance.viewOpportunities) == null ? void 0 : _j.length) ?? 0) === 0 ? /* @__PURE__ */ jsxs(Table.Row, { children: [
3752
3765
  /* @__PURE__ */ jsx(Table.Cell, { children: /* @__PURE__ */ jsx(Text, { className: "text-ui-fg-muted text-xs", children: "No product view opportunities yet." }) }),
3753
3766
  /* @__PURE__ */ jsx(Table.Cell, {}),
3754
3767
  /* @__PURE__ */ jsx(Table.Cell, {}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "medusa-analytics",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "description": "A starter for Medusa plugins.",
5
5
  "author": "Medusa (https://medusajs.com)",
6
6
  "license": "MIT",