@reeboot/strapi-payment-plugin 0.0.4 → 0.0.6

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 (46) hide show
  1. package/dist/_chunks/{Analytics-nBSdLT2v.js → Analytics-CLjtRWYA.js} +68 -51
  2. package/dist/_chunks/{Analytics-DSJqY9ng.mjs → Analytics-CQmAVKsq.mjs} +68 -51
  3. package/dist/_chunks/App-DXN62SV6.mjs +118 -0
  4. package/dist/_chunks/App-Dk7XtjNA.js +120 -0
  5. package/dist/_chunks/{Customers-BpFzfglV.js → Customers-BNDi4QBH.js} +113 -51
  6. package/dist/_chunks/{Customers-C6FH7-zG.mjs → Customers-BQzVBQDT.mjs} +114 -52
  7. package/dist/_chunks/Dashboard-CuHC-dit.mjs +311 -0
  8. package/dist/_chunks/Dashboard-UUwohHZa.js +311 -0
  9. package/dist/_chunks/{Orders-CBkT2YfP.mjs → Orders-65mNfu2i.mjs} +140 -80
  10. package/dist/_chunks/{Orders-OG-pwV-B.js → Orders-CitNCdWE.js} +139 -79
  11. package/dist/_chunks/PaymentList-B0CAzInT.mjs +137 -0
  12. package/dist/_chunks/PaymentList-Dy1BAFoD.js +136 -0
  13. package/dist/_chunks/{Payments-DSDJ-HWm.mjs → Payments-FnhoV_2B.mjs} +175 -136
  14. package/dist/_chunks/{Payments-BLen1P9N.js → Payments-TOnygGIW.js} +173 -134
  15. package/dist/_chunks/Settings-BJtDagUs.js +644 -0
  16. package/dist/_chunks/Settings-EoLSuZLe.mjs +644 -0
  17. package/dist/_chunks/{index-DS_PYNkf.mjs → index-2Zd_T7bD.mjs} +1 -1
  18. package/dist/_chunks/{index-BqqrpI6D.js → index-CHEgJ7e5.js} +1 -1
  19. package/dist/admin/index.js +1 -1
  20. package/dist/admin/index.mjs +1 -1
  21. package/dist/admin/src/components/CustomerList.d.ts +1 -13
  22. package/dist/admin/src/components/IntegrationModal.d.ts +7 -0
  23. package/dist/admin/src/components/OrderList.d.ts +1 -19
  24. package/dist/admin/src/components/PaymentCard.d.ts +2 -33
  25. package/dist/admin/src/components/PaymentList.d.ts +3 -11
  26. package/dist/admin/src/components/RefundModal.d.ts +2 -8
  27. package/dist/admin/src/types/index.d.ts +47 -0
  28. package/dist/server/index.js +241 -96
  29. package/dist/server/index.mjs +241 -96
  30. package/dist/server/src/content-types/index.d.ts +9 -2
  31. package/dist/server/src/content-types/order/index.d.ts +8 -1
  32. package/dist/server/src/content-types/payment/index.d.ts +1 -1
  33. package/dist/server/src/index.d.ts +9 -2
  34. package/dist/server/src/types/api.d.ts +31 -0
  35. package/dist/server/src/types/customer.d.ts +2 -0
  36. package/dist/server/src/types/index.d.ts +4 -179
  37. package/dist/server/src/types/order.d.ts +2 -0
  38. package/dist/server/src/types/payment.d.ts +2 -0
  39. package/package.json +8 -7
  40. package/dist/_chunks/App-B83DZ9NG.js +0 -70
  41. package/dist/_chunks/App-BUSTbkyy.mjs +0 -68
  42. package/dist/_chunks/Dashboard-CNMTzSyc.js +0 -180
  43. package/dist/_chunks/Dashboard-Dbwl0ZBo.mjs +0 -180
  44. package/dist/_chunks/Settings-Dq1xy32B.js +0 -357
  45. package/dist/_chunks/Settings-jmGslDsB.mjs +0 -357
  46. package/dist/admin/src/pages/HomePage.d.ts +0 -2
@@ -3,9 +3,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const designSystem = require("@strapi/design-system");
6
+ const icons = require("@strapi/icons");
6
7
  const reactIntl = require("react-intl");
7
8
  const admin = require("@strapi/strapi/admin");
8
- const index = require("./index-BqqrpI6D.js");
9
+ const index = require("./index-CHEgJ7e5.js");
9
10
  const AnalyticsChart = ({ data, currency = "usd", type }) => {
10
11
  const formatCurrency = (amount) => {
11
12
  return new Intl.NumberFormat("en-US", {
@@ -17,42 +18,49 @@ const AnalyticsChart = ({ data, currency = "usd", type }) => {
17
18
  return new Intl.NumberFormat("en-US").format(num);
18
19
  };
19
20
  const renderLineChart = (trendData) => {
20
- const maxRevenue = Math.max(...trendData.revenue);
21
- const maxPayments = Math.max(...trendData.payments);
22
- const maxCustomers = Math.max(...trendData.customers);
23
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 4, children: [
24
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { marginBottom: 4, children: [
25
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", fontWeight: "bold", children: "Revenue Trend" }),
26
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "row", gap: 8, children: trendData.labels.map((label, index2) => {
21
+ const maxRevenue = Math.max(...trendData.revenue, 1);
22
+ const maxPayments = Math.max(...trendData.payments, 1);
23
+ const maxCustomers = Math.max(...trendData.customers, 1);
24
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 6, children: [
25
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 4, background: "neutral100", borderRadius: "4px", children: [
26
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", fontWeight: "bold", marginBottom: 4, display: "block", children: "Daily Revenue" }),
27
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", gap: 4, children: trendData.labels.map((label, index2) => {
27
28
  const revenueValue = trendData.revenue[index2];
28
29
  const percentage = revenueValue / maxRevenue * 100;
29
- console.log("Revenue Value:", revenueValue, "Percentage:", percentage);
30
- console.log("trend data:", trendData);
31
30
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
32
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "space-between", marginBottom: 1, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", fontWeight: "bold", children: formatCurrency(revenueValue) }) }),
33
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.ProgressBar, { value: percentage })
31
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", marginBottom: 1, children: [
32
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral700", children: label }),
33
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: formatCurrency(revenueValue) })
34
+ ] }),
35
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.ProgressBar, { value: percentage, size: "S" })
34
36
  ] }, index2);
35
37
  }) })
36
38
  ] }) }),
37
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { marginBottom: 4, children: [
38
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", fontWeight: "bold", children: "Payments Trend" }),
39
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", gap: 2, children: trendData.labels.map((label, index2) => {
39
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 4, background: "neutral100", borderRadius: "4px", children: [
40
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", fontWeight: "bold", marginBottom: 4, display: "block", children: "Daily Transactions" }),
41
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", gap: 4, children: trendData.labels.map((label, index2) => {
40
42
  const paymentsValue = trendData.payments[index2];
41
43
  const percentage = paymentsValue / maxPayments * 100;
42
44
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
43
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "space-between", marginBottom: 1, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", fontWeight: "bold", children: formatNumber(paymentsValue) }) }),
44
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.ProgressBar, { value: percentage })
45
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", marginBottom: 1, children: [
46
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral700", children: label }),
47
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: formatNumber(paymentsValue) })
48
+ ] }),
49
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.ProgressBar, { value: percentage, size: "S" })
45
50
  ] }, index2);
46
51
  }) })
47
52
  ] }) }),
48
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { marginBottom: 4, children: [
49
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", fontWeight: "bold", children: "Customer Growth" }),
50
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", gap: 2, children: trendData.labels.map((label, index2) => {
53
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 4, background: "neutral100", borderRadius: "4px", children: [
54
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", fontWeight: "bold", marginBottom: 4, display: "block", children: "Customers" }),
55
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", gap: 4, children: trendData.labels.map((label, index2) => {
51
56
  const customersValue = trendData.customers[index2];
52
57
  const percentage = customersValue / maxCustomers * 100;
53
58
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
54
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "space-between", marginBottom: 1, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", fontWeight: "bold", children: formatNumber(customersValue) }) }),
55
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.ProgressBar, { value: percentage })
59
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", marginBottom: 1, children: [
60
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral700", children: label }),
61
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: formatNumber(customersValue) })
62
+ ] }),
63
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.ProgressBar, { value: percentage, size: "S" })
56
64
  ] }, index2);
57
65
  }) })
58
66
  ] }) })
@@ -213,10 +221,10 @@ const Analytics = () => {
213
221
  window.URL.revokeObjectURL(url);
214
222
  };
215
223
  if (loading) {
216
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", alignItems: "center", style: { minHeight: "400px" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, {}) }) });
224
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", alignItems: "center", style: { minHeight: "400px" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, {}) }) });
217
225
  }
218
226
  if (error) {
219
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
227
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(
220
228
  designSystem.EmptyStateLayout,
221
229
  {
222
230
  title: "Error loading analytics",
@@ -226,7 +234,7 @@ const Analytics = () => {
226
234
  ) });
227
235
  }
228
236
  if (!analyticsData) return null;
229
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { paddingLeft: 10, paddingRight: 10, paddingTop: 4, children: [
237
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
230
238
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginBottom: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", children: [
231
239
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
232
240
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", tag: "h1", children: formatMessage({ id: "payment-plugin.analytics.title", defaultMessage: "Analytics" }) }),
@@ -261,38 +269,47 @@ const Analytics = () => {
261
269
  ]
262
270
  }
263
271
  ),
264
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "secondary", onClick: exportReport, children: formatMessage({ id: "payment-plugin.analytics.export", defaultMessage: "Export Report" }) }),
265
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: fetchAnalyticsData, children: formatMessage({ id: "payment-plugin.analytics.refresh", defaultMessage: "Refresh" }) })
272
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "secondary", startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Download, {}), onClick: exportReport, children: formatMessage({ id: "payment-plugin.analytics.export", defaultMessage: "Export Report" }) }),
273
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowClockwise, {}), onClick: fetchAnalyticsData, children: formatMessage({ id: "payment-plugin.analytics.refresh", defaultMessage: "Refresh" }) })
266
274
  ] })
267
275
  ] }) }),
268
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 4, marginBottom: 4, children: [
269
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Card, { style: { width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
270
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", children: formatMessage({ id: "payment-plugin.analytics.totalRevenue", defaultMessage: "Total Revenue" }) }),
271
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", fontWeight: "bold", children: formatCurrency(analyticsData.revenue.total, currency) }),
272
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", children: [
273
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Badge, { size: "S", backgroundColor: "success", children: [
274
- "+",
275
- analyticsData.revenue.growth,
276
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 4, marginBottom: 6, children: [
277
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Card, { style: { width: "100%", borderLeft: "4px solid #4945FF" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 5, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "flex-start", children: [
278
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, alignItems: "flex-start", children: [
279
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", children: formatMessage({ id: "payment-plugin.analytics.totalRevenue", defaultMessage: "Total Revenue" }) }),
280
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", fontWeight: "bold", children: formatCurrency(analyticsData.revenue.total, currency) }),
281
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", children: [
282
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { size: "S", backgroundColor: "success", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 1, alignItems: "center", children: [
283
+ /* @__PURE__ */ jsxRuntime.jsx(icons.TrendUp, { width: "12px", height: "12px" }),
284
+ analyticsData.revenue.growth,
285
+ "%"
286
+ ] }) }),
287
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: "vs prev period" })
288
+ ] })
289
+ ] }),
290
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, backgroundColor: "primary100", borderRadius: "50%", children: /* @__PURE__ */ jsxRuntime.jsx(icons.ChartPie, { width: "24px", height: "24px" }) })
291
+ ] }) }) }) }),
292
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Card, { style: { width: "100%", borderLeft: "4px solid #0F9D58" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 5, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "flex-start", children: [
293
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, alignItems: "flex-start", children: [
294
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", children: formatMessage({ id: "payment-plugin.analytics.successRate", defaultMessage: "Success Rate" }) }),
295
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "alpha", fontWeight: "bold", children: [
296
+ analyticsData.payments.successRate,
276
297
  "%"
277
298
  ] }),
278
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", children: analyticsData.revenue.period })
279
- ] })
280
- ] }) }) }) }),
281
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Card, { style: { width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
282
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", children: formatMessage({ id: "payment-plugin.analytics.successRate", defaultMessage: "Success Rate" }) }),
283
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "delta", fontWeight: "bold", children: [
284
- analyticsData.payments.successRate,
285
- "%"
299
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: formatMessage(
300
+ { id: "payment-plugin.analytics.outOfPayments", defaultMessage: "{total} total payments" },
301
+ { total: analyticsData.payments.total }
302
+ ) })
286
303
  ] }),
287
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", children: formatMessage(
288
- { id: "payment-plugin.analytics.outOfPayments", defaultMessage: "{total} payments" },
289
- { total: analyticsData.payments.total }
290
- ) })
304
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, backgroundColor: "success100", borderRadius: "50%", children: /* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { width: "24px", height: "24px" }) })
291
305
  ] }) }) }) }),
292
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Card, { style: { width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
293
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", children: formatMessage({ id: "payment-plugin.analytics.averageAmount", defaultMessage: "Average Amount" }) }),
294
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", fontWeight: "bold", children: formatCurrency(analyticsData.payments.averageAmount, currency) }),
295
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", children: analyticsData.payments.period })
306
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Card, { style: { width: "100%", borderLeft: "4px solid #9C27B0" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 5, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "flex-start", children: [
307
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, alignItems: "flex-start", children: [
308
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", children: formatMessage({ id: "payment-plugin.analytics.averageAmount", defaultMessage: "Avg. Transaction" }) }),
309
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", fontWeight: "bold", children: formatCurrency(analyticsData.payments.averageAmount, currency) }),
310
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: "Per successful payment" })
311
+ ] }),
312
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, backgroundColor: "secondary100", borderRadius: "50%", children: /* @__PURE__ */ jsxRuntime.jsx(icons.User, { width: "24px", height: "24px" }) })
296
313
  ] }) }) }) })
297
314
  ] }),
298
315
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 4, marginBottom: 4, children: [
@@ -1,9 +1,10 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useState, useEffect } from "react";
3
3
  import { Box, Typography, Flex, ProgressBar, Grid, Loader, EmptyStateLayout, Button, SingleSelect, SingleSelectOption, Card, Badge, Table, Thead, Tr, Th, Tbody, Td } from "@strapi/design-system";
4
+ import { Download, ArrowClockwise, TrendUp, ChartPie, CheckCircle, User } from "@strapi/icons";
4
5
  import { useIntl } from "react-intl";
5
6
  import { useFetchClient } from "@strapi/strapi/admin";
6
- import { P as PLUGIN_ID } from "./index-DS_PYNkf.mjs";
7
+ import { P as PLUGIN_ID } from "./index-2Zd_T7bD.mjs";
7
8
  const AnalyticsChart = ({ data, currency = "usd", type }) => {
8
9
  const formatCurrency = (amount) => {
9
10
  return new Intl.NumberFormat("en-US", {
@@ -15,42 +16,49 @@ const AnalyticsChart = ({ data, currency = "usd", type }) => {
15
16
  return new Intl.NumberFormat("en-US").format(num);
16
17
  };
17
18
  const renderLineChart = (trendData) => {
18
- const maxRevenue = Math.max(...trendData.revenue);
19
- const maxPayments = Math.max(...trendData.payments);
20
- const maxCustomers = Math.max(...trendData.customers);
21
- return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Grid.Root, { gap: 4, children: [
22
- /* @__PURE__ */ jsx(Grid.Item, { col: 3, children: /* @__PURE__ */ jsxs(Box, { marginBottom: 4, children: [
23
- /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", fontWeight: "bold", children: "Revenue Trend" }),
24
- /* @__PURE__ */ jsx(Flex, { direction: "row", gap: 8, children: trendData.labels.map((label, index) => {
19
+ const maxRevenue = Math.max(...trendData.revenue, 1);
20
+ const maxPayments = Math.max(...trendData.payments, 1);
21
+ const maxCustomers = Math.max(...trendData.customers, 1);
22
+ return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Grid.Root, { gap: 6, children: [
23
+ /* @__PURE__ */ jsx(Grid.Item, { col: 4, children: /* @__PURE__ */ jsxs(Box, { padding: 4, background: "neutral100", borderRadius: "4px", children: [
24
+ /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", fontWeight: "bold", marginBottom: 4, display: "block", children: "Daily Revenue" }),
25
+ /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 4, children: trendData.labels.map((label, index) => {
25
26
  const revenueValue = trendData.revenue[index];
26
27
  const percentage = revenueValue / maxRevenue * 100;
27
- console.log("Revenue Value:", revenueValue, "Percentage:", percentage);
28
- console.log("trend data:", trendData);
29
28
  return /* @__PURE__ */ jsxs(Box, { children: [
30
- /* @__PURE__ */ jsx(Flex, { justifyContent: "space-between", marginBottom: 1, children: /* @__PURE__ */ jsx(Typography, { variant: "epsilon", fontWeight: "bold", children: formatCurrency(revenueValue) }) }),
31
- /* @__PURE__ */ jsx(ProgressBar, { value: percentage })
29
+ /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", marginBottom: 1, children: [
30
+ /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral700", children: label }),
31
+ /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: formatCurrency(revenueValue) })
32
+ ] }),
33
+ /* @__PURE__ */ jsx(ProgressBar, { value: percentage, size: "S" })
32
34
  ] }, index);
33
35
  }) })
34
36
  ] }) }),
35
- /* @__PURE__ */ jsx(Grid.Item, { col: 3, children: /* @__PURE__ */ jsxs(Box, { marginBottom: 4, children: [
36
- /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", fontWeight: "bold", children: "Payments Trend" }),
37
- /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 2, children: trendData.labels.map((label, index) => {
37
+ /* @__PURE__ */ jsx(Grid.Item, { col: 4, children: /* @__PURE__ */ jsxs(Box, { padding: 4, background: "neutral100", borderRadius: "4px", children: [
38
+ /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", fontWeight: "bold", marginBottom: 4, display: "block", children: "Daily Transactions" }),
39
+ /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 4, children: trendData.labels.map((label, index) => {
38
40
  const paymentsValue = trendData.payments[index];
39
41
  const percentage = paymentsValue / maxPayments * 100;
40
42
  return /* @__PURE__ */ jsxs(Box, { children: [
41
- /* @__PURE__ */ jsx(Flex, { justifyContent: "space-between", marginBottom: 1, children: /* @__PURE__ */ jsx(Typography, { variant: "epsilon", fontWeight: "bold", children: formatNumber(paymentsValue) }) }),
42
- /* @__PURE__ */ jsx(ProgressBar, { value: percentage })
43
+ /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", marginBottom: 1, children: [
44
+ /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral700", children: label }),
45
+ /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: formatNumber(paymentsValue) })
46
+ ] }),
47
+ /* @__PURE__ */ jsx(ProgressBar, { value: percentage, size: "S" })
43
48
  ] }, index);
44
49
  }) })
45
50
  ] }) }),
46
- /* @__PURE__ */ jsx(Grid.Item, { col: 3, children: /* @__PURE__ */ jsxs(Box, { marginBottom: 4, children: [
47
- /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", fontWeight: "bold", children: "Customer Growth" }),
48
- /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 2, children: trendData.labels.map((label, index) => {
51
+ /* @__PURE__ */ jsx(Grid.Item, { col: 4, children: /* @__PURE__ */ jsxs(Box, { padding: 4, background: "neutral100", borderRadius: "4px", children: [
52
+ /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", fontWeight: "bold", marginBottom: 4, display: "block", children: "Customers" }),
53
+ /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 4, children: trendData.labels.map((label, index) => {
49
54
  const customersValue = trendData.customers[index];
50
55
  const percentage = customersValue / maxCustomers * 100;
51
56
  return /* @__PURE__ */ jsxs(Box, { children: [
52
- /* @__PURE__ */ jsx(Flex, { justifyContent: "space-between", marginBottom: 1, children: /* @__PURE__ */ jsx(Typography, { variant: "epsilon", fontWeight: "bold", children: formatNumber(customersValue) }) }),
53
- /* @__PURE__ */ jsx(ProgressBar, { value: percentage })
57
+ /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", marginBottom: 1, children: [
58
+ /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral700", children: label }),
59
+ /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: formatNumber(customersValue) })
60
+ ] }),
61
+ /* @__PURE__ */ jsx(ProgressBar, { value: percentage, size: "S" })
54
62
  ] }, index);
55
63
  }) })
56
64
  ] }) })
@@ -211,10 +219,10 @@ const Analytics = () => {
211
219
  window.URL.revokeObjectURL(url);
212
220
  };
213
221
  if (loading) {
214
- return /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsx(Flex, { justifyContent: "center", alignItems: "center", style: { minHeight: "400px" }, children: /* @__PURE__ */ jsx(Loader, {}) }) });
222
+ return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Flex, { justifyContent: "center", alignItems: "center", style: { minHeight: "400px" }, children: /* @__PURE__ */ jsx(Loader, {}) }) });
215
223
  }
216
224
  if (error) {
217
- return /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsx(
225
+ return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
218
226
  EmptyStateLayout,
219
227
  {
220
228
  title: "Error loading analytics",
@@ -224,7 +232,7 @@ const Analytics = () => {
224
232
  ) });
225
233
  }
226
234
  if (!analyticsData) return null;
227
- return /* @__PURE__ */ jsxs(Box, { paddingLeft: 10, paddingRight: 10, paddingTop: 4, children: [
235
+ return /* @__PURE__ */ jsxs(Box, { children: [
228
236
  /* @__PURE__ */ jsx(Box, { marginBottom: 4, children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", children: [
229
237
  /* @__PURE__ */ jsxs(Box, { children: [
230
238
  /* @__PURE__ */ jsx(Typography, { variant: "alpha", tag: "h1", children: formatMessage({ id: "payment-plugin.analytics.title", defaultMessage: "Analytics" }) }),
@@ -259,38 +267,47 @@ const Analytics = () => {
259
267
  ]
260
268
  }
261
269
  ),
262
- /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: exportReport, children: formatMessage({ id: "payment-plugin.analytics.export", defaultMessage: "Export Report" }) }),
263
- /* @__PURE__ */ jsx(Button, { onClick: fetchAnalyticsData, children: formatMessage({ id: "payment-plugin.analytics.refresh", defaultMessage: "Refresh" }) })
270
+ /* @__PURE__ */ jsx(Button, { variant: "secondary", startIcon: /* @__PURE__ */ jsx(Download, {}), onClick: exportReport, children: formatMessage({ id: "payment-plugin.analytics.export", defaultMessage: "Export Report" }) }),
271
+ /* @__PURE__ */ jsx(Button, { startIcon: /* @__PURE__ */ jsx(ArrowClockwise, {}), onClick: fetchAnalyticsData, children: formatMessage({ id: "payment-plugin.analytics.refresh", defaultMessage: "Refresh" }) })
264
272
  ] })
265
273
  ] }) }),
266
- /* @__PURE__ */ jsxs(Grid.Root, { gap: 4, marginBottom: 4, children: [
267
- /* @__PURE__ */ jsx(Grid.Item, { col: 4, children: /* @__PURE__ */ jsx(Card, { style: { width: "100%" }, children: /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
268
- /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", children: formatMessage({ id: "payment-plugin.analytics.totalRevenue", defaultMessage: "Total Revenue" }) }),
269
- /* @__PURE__ */ jsx(Typography, { variant: "delta", fontWeight: "bold", children: formatCurrency(analyticsData.revenue.total, currency) }),
270
- /* @__PURE__ */ jsxs(Flex, { gap: 2, alignItems: "center", children: [
271
- /* @__PURE__ */ jsxs(Badge, { size: "S", backgroundColor: "success", children: [
272
- "+",
273
- analyticsData.revenue.growth,
274
+ /* @__PURE__ */ jsxs(Grid.Root, { gap: 4, marginBottom: 6, children: [
275
+ /* @__PURE__ */ jsx(Grid.Item, { col: 4, children: /* @__PURE__ */ jsx(Card, { style: { width: "100%", borderLeft: "4px solid #4945FF" }, children: /* @__PURE__ */ jsx(Box, { padding: 5, children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "flex-start", children: [
276
+ /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, alignItems: "flex-start", children: [
277
+ /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", children: formatMessage({ id: "payment-plugin.analytics.totalRevenue", defaultMessage: "Total Revenue" }) }),
278
+ /* @__PURE__ */ jsx(Typography, { variant: "alpha", fontWeight: "bold", children: formatCurrency(analyticsData.revenue.total, currency) }),
279
+ /* @__PURE__ */ jsxs(Flex, { gap: 2, alignItems: "center", children: [
280
+ /* @__PURE__ */ jsx(Badge, { size: "S", backgroundColor: "success", children: /* @__PURE__ */ jsxs(Flex, { gap: 1, alignItems: "center", children: [
281
+ /* @__PURE__ */ jsx(TrendUp, { width: "12px", height: "12px" }),
282
+ analyticsData.revenue.growth,
283
+ "%"
284
+ ] }) }),
285
+ /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: "vs prev period" })
286
+ ] })
287
+ ] }),
288
+ /* @__PURE__ */ jsx(Box, { padding: 2, backgroundColor: "primary100", borderRadius: "50%", children: /* @__PURE__ */ jsx(ChartPie, { width: "24px", height: "24px" }) })
289
+ ] }) }) }) }),
290
+ /* @__PURE__ */ jsx(Grid.Item, { col: 4, children: /* @__PURE__ */ jsx(Card, { style: { width: "100%", borderLeft: "4px solid #0F9D58" }, children: /* @__PURE__ */ jsx(Box, { padding: 5, children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "flex-start", children: [
291
+ /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, alignItems: "flex-start", children: [
292
+ /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", children: formatMessage({ id: "payment-plugin.analytics.successRate", defaultMessage: "Success Rate" }) }),
293
+ /* @__PURE__ */ jsxs(Typography, { variant: "alpha", fontWeight: "bold", children: [
294
+ analyticsData.payments.successRate,
274
295
  "%"
275
296
  ] }),
276
- /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", children: analyticsData.revenue.period })
277
- ] })
278
- ] }) }) }) }),
279
- /* @__PURE__ */ jsx(Grid.Item, { col: 4, children: /* @__PURE__ */ jsx(Card, { style: { width: "100%" }, children: /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
280
- /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", children: formatMessage({ id: "payment-plugin.analytics.successRate", defaultMessage: "Success Rate" }) }),
281
- /* @__PURE__ */ jsxs(Typography, { variant: "delta", fontWeight: "bold", children: [
282
- analyticsData.payments.successRate,
283
- "%"
297
+ /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: formatMessage(
298
+ { id: "payment-plugin.analytics.outOfPayments", defaultMessage: "{total} total payments" },
299
+ { total: analyticsData.payments.total }
300
+ ) })
284
301
  ] }),
285
- /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", children: formatMessage(
286
- { id: "payment-plugin.analytics.outOfPayments", defaultMessage: "{total} payments" },
287
- { total: analyticsData.payments.total }
288
- ) })
302
+ /* @__PURE__ */ jsx(Box, { padding: 2, backgroundColor: "success100", borderRadius: "50%", children: /* @__PURE__ */ jsx(CheckCircle, { width: "24px", height: "24px" }) })
289
303
  ] }) }) }) }),
290
- /* @__PURE__ */ jsx(Grid.Item, { col: 4, children: /* @__PURE__ */ jsx(Card, { style: { width: "100%" }, children: /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
291
- /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", children: formatMessage({ id: "payment-plugin.analytics.averageAmount", defaultMessage: "Average Amount" }) }),
292
- /* @__PURE__ */ jsx(Typography, { variant: "delta", fontWeight: "bold", children: formatCurrency(analyticsData.payments.averageAmount, currency) }),
293
- /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", children: analyticsData.payments.period })
304
+ /* @__PURE__ */ jsx(Grid.Item, { col: 4, children: /* @__PURE__ */ jsx(Card, { style: { width: "100%", borderLeft: "4px solid #9C27B0" }, children: /* @__PURE__ */ jsx(Box, { padding: 5, children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "flex-start", children: [
305
+ /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, alignItems: "flex-start", children: [
306
+ /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", textTransform: "uppercase", children: formatMessage({ id: "payment-plugin.analytics.averageAmount", defaultMessage: "Avg. Transaction" }) }),
307
+ /* @__PURE__ */ jsx(Typography, { variant: "alpha", fontWeight: "bold", children: formatCurrency(analyticsData.payments.averageAmount, currency) }),
308
+ /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: "Per successful payment" })
309
+ ] }),
310
+ /* @__PURE__ */ jsx(Box, { padding: 2, backgroundColor: "secondary100", borderRadius: "50%", children: /* @__PURE__ */ jsx(User, { width: "24px", height: "24px" }) })
294
311
  ] }) }) }) })
295
312
  ] }),
296
313
  /* @__PURE__ */ jsxs(Grid.Root, { gap: 4, marginBottom: 4, children: [
@@ -0,0 +1,118 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import React, { useState, Suspense } from "react";
3
+ import { Routes, Route, Navigate } from "react-router-dom";
4
+ import { useIntl } from "react-intl";
5
+ import { Flex, Divider, Box, Searchbar, Loader } from "@strapi/design-system";
6
+ import { SubNav } from "@strapi/strapi/admin";
7
+ import { P as PLUGIN_ID } from "./index-2Zd_T7bD.mjs";
8
+ const Dashboard = React.lazy(() => import("./Dashboard-CuHC-dit.mjs").then((m) => ({ default: m.Dashboard })));
9
+ const Payments = React.lazy(() => import("./Payments-FnhoV_2B.mjs").then((m) => ({ default: m.Payments })));
10
+ const Orders = React.lazy(() => import("./Orders-65mNfu2i.mjs").then((m) => ({ default: m.Orders })));
11
+ const Customers = React.lazy(() => import("./Customers-BQzVBQDT.mjs").then((m) => ({ default: m.Customers })));
12
+ const Analytics = React.lazy(() => import("./Analytics-CQmAVKsq.mjs").then((m) => ({ default: m.Analytics })));
13
+ const Settings = React.lazy(() => import("./Settings-EoLSuZLe.mjs").then((m) => ({ default: m.Settings })));
14
+ const App = () => {
15
+ const { formatMessage } = useIntl();
16
+ const [searchValue, setSearchValue] = useState("");
17
+ const managementLinks = [
18
+ {
19
+ to: `/plugins/${PLUGIN_ID}/dashboard`,
20
+ label: formatMessage({ id: "payment-plugin.dashboard.title", defaultMessage: "Dashboard" })
21
+ },
22
+ {
23
+ to: `/plugins/${PLUGIN_ID}/payments`,
24
+ label: formatMessage({ id: "payment-plugin.payments.title", defaultMessage: "Payments" })
25
+ },
26
+ {
27
+ to: `/plugins/${PLUGIN_ID}/orders`,
28
+ label: formatMessage({ id: "payment-plugin.orders.title", defaultMessage: "Orders" })
29
+ },
30
+ {
31
+ to: `/plugins/${PLUGIN_ID}/customers`,
32
+ label: formatMessage({ id: "payment-plugin.customers.title", defaultMessage: "Customers" })
33
+ }
34
+ ];
35
+ const insightLinks = [
36
+ {
37
+ to: `/plugins/${PLUGIN_ID}/analytics`,
38
+ label: formatMessage({ id: "payment-plugin.analytics.title", defaultMessage: "Analytics" })
39
+ }
40
+ ];
41
+ const configLinks = [
42
+ {
43
+ to: `/plugins/${PLUGIN_ID}/settings`,
44
+ label: formatMessage({ id: "payment-plugin.settings.title", defaultMessage: "Settings" })
45
+ }
46
+ ];
47
+ const filterLinks = (links) => {
48
+ return links.filter(
49
+ (link) => link.label.toLowerCase().includes(searchValue.toLowerCase())
50
+ );
51
+ };
52
+ const filteredManagementLinks = filterLinks(managementLinks);
53
+ const filteredInsightLinks = filterLinks(insightLinks);
54
+ const filteredConfigLinks = filterLinks(configLinks);
55
+ const pluginName = formatMessage({
56
+ id: "payment-plugin.plugin.name",
57
+ defaultMessage: "Payment Plugin"
58
+ });
59
+ return /* @__PURE__ */ jsxs(Flex, { alignItems: "stretch", children: [
60
+ /* @__PURE__ */ jsxs(SubNav.Main, { "aria-label": formatMessage({ id: "payment-plugin.nav.aria", defaultMessage: "Payment navigation" }), children: [
61
+ /* @__PURE__ */ jsx(SubNav.Header, { label: pluginName }),
62
+ /* @__PURE__ */ jsx(Divider, { background: "neutral150" }),
63
+ /* @__PURE__ */ jsxs(SubNav.Content, { children: [
64
+ /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsx(
65
+ Searchbar,
66
+ {
67
+ name: "searchbar",
68
+ onClear: () => setSearchValue(""),
69
+ value: searchValue,
70
+ onChange: (e) => setSearchValue(e.target.value),
71
+ clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
72
+ placeholder: formatMessage({ id: "payment-plugin.nav.search.placeholder", defaultMessage: "Search..." }),
73
+ size: "S",
74
+ children: formatMessage({ id: "payment-plugin.nav.search.placeholder", defaultMessage: "Search..." })
75
+ }
76
+ ) }),
77
+ /* @__PURE__ */ jsxs(SubNav.Sections, { children: [
78
+ filteredManagementLinks.length > 0 && /* @__PURE__ */ jsx(SubNav.Section, { label: formatMessage({ id: "payment-plugin.nav.management", defaultMessage: "Management" }), children: filteredManagementLinks.map((link) => /* @__PURE__ */ jsx(
79
+ SubNav.Link,
80
+ {
81
+ to: link.to,
82
+ label: link.label
83
+ },
84
+ link.to
85
+ )) }),
86
+ filteredInsightLinks.length > 0 && /* @__PURE__ */ jsx(SubNav.Section, { label: formatMessage({ id: "payment-plugin.nav.insights", defaultMessage: "Insights" }), children: filteredInsightLinks.map((link) => /* @__PURE__ */ jsx(
87
+ SubNav.Link,
88
+ {
89
+ to: link.to,
90
+ label: link.label
91
+ },
92
+ link.to
93
+ )) }),
94
+ filteredConfigLinks.length > 0 && /* @__PURE__ */ jsx(SubNav.Section, { label: formatMessage({ id: "payment-plugin.nav.configuration", defaultMessage: "Configuration" }), children: filteredConfigLinks.map((link) => /* @__PURE__ */ jsx(
95
+ SubNav.Link,
96
+ {
97
+ to: link.to,
98
+ label: link.label
99
+ },
100
+ link.to
101
+ )) })
102
+ ] })
103
+ ] })
104
+ ] }),
105
+ /* @__PURE__ */ jsx(Box, { flex: "1", padding: 5, children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Flex, { justifyContent: "center", padding: 12, children: /* @__PURE__ */ jsx(Loader, {}) }), children: /* @__PURE__ */ jsxs(Routes, { children: [
106
+ /* @__PURE__ */ jsx(Route, { path: "dashboard", element: /* @__PURE__ */ jsx(Dashboard, {}) }),
107
+ /* @__PURE__ */ jsx(Route, { path: "payments", element: /* @__PURE__ */ jsx(Payments, {}) }),
108
+ /* @__PURE__ */ jsx(Route, { path: "orders", element: /* @__PURE__ */ jsx(Orders, {}) }),
109
+ /* @__PURE__ */ jsx(Route, { path: "customers", element: /* @__PURE__ */ jsx(Customers, {}) }),
110
+ /* @__PURE__ */ jsx(Route, { path: "analytics", element: /* @__PURE__ */ jsx(Analytics, {}) }),
111
+ /* @__PURE__ */ jsx(Route, { path: "settings", element: /* @__PURE__ */ jsx(Settings, {}) }),
112
+ /* @__PURE__ */ jsx(Route, { path: "*", element: /* @__PURE__ */ jsx(Navigate, { to: "dashboard", replace: true }) })
113
+ ] }) }) })
114
+ ] });
115
+ };
116
+ export {
117
+ App
118
+ };