order-management 0.0.86 → 0.0.87
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.
|
@@ -2,7 +2,7 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { defineWidgetConfig, defineRouteConfig } from "@medusajs/admin-sdk";
|
|
3
3
|
import { useState, useEffect, useRef, useCallback, useMemo } from "react";
|
|
4
4
|
import { Container, Text, Heading, Badge, Button, Label, Select, Textarea, Input } from "@medusajs/ui";
|
|
5
|
-
import { CashSolid, PencilSquareSolid, Trash, ArrowPath,
|
|
5
|
+
import { CashSolid, PencilSquareSolid, Trash, ArrowPath, Receipt, CreditCard, ArrowLeft, CheckCircle } from "@medusajs/icons";
|
|
6
6
|
import { useNavigate, useParams } from "react-router-dom";
|
|
7
7
|
function roundRectPath(ctx, x, y, w, h, r) {
|
|
8
8
|
ctx.beginPath();
|
|
@@ -1095,212 +1095,275 @@ const useDebounce$2 = (value, delay) => {
|
|
|
1095
1095
|
return debouncedValue;
|
|
1096
1096
|
};
|
|
1097
1097
|
const getStatusBadgeClass$6 = (status) => {
|
|
1098
|
-
const
|
|
1099
|
-
if (
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
if (
|
|
1103
|
-
return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
1104
|
-
}
|
|
1105
|
-
if (statusLower === "requires_action") {
|
|
1106
|
-
return "bg-ui-tag-red-bg text-ui-tag-red-text";
|
|
1107
|
-
}
|
|
1108
|
-
if (statusLower === "completed") {
|
|
1109
|
-
return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
1110
|
-
}
|
|
1111
|
-
if (statusLower === "canceled") {
|
|
1112
|
-
return "bg-ui-tag-grey-bg text-ui-tag-grey-text";
|
|
1113
|
-
}
|
|
1098
|
+
const s2 = status.toLowerCase();
|
|
1099
|
+
if (s2 === "captured" || s2 === "completed") return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
1100
|
+
if (s2 === "authorized") return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
1101
|
+
if (s2 === "error" || s2 === "canceled" || s2 === "cancelled") return "bg-ui-tag-red-bg text-ui-tag-red-text";
|
|
1102
|
+
if (s2 === "pending" || s2 === "requires_more") return "bg-ui-tag-orange-bg text-ui-tag-orange-text";
|
|
1114
1103
|
return "bg-ui-tag-purple-bg text-ui-tag-purple-text";
|
|
1115
1104
|
};
|
|
1116
|
-
const
|
|
1105
|
+
const RefundsPage = () => {
|
|
1117
1106
|
const navigate = useNavigate();
|
|
1118
1107
|
const [items, setItems] = useState([]);
|
|
1119
|
-
const [
|
|
1120
|
-
const
|
|
1121
|
-
const [
|
|
1122
|
-
const
|
|
1108
|
+
const [orderIdSearch, setOrderIdSearch] = useState("");
|
|
1109
|
+
const debouncedOrderId = useDebounce$2(orderIdSearch, 300);
|
|
1110
|
+
const [paymentStatusFilter, setPaymentStatusFilter] = useState("all");
|
|
1111
|
+
const [providerSearch, setProviderSearch] = useState("");
|
|
1112
|
+
const debouncedProvider = useDebounce$2(providerSearch, 300);
|
|
1113
|
+
const [currencySearch, setCurrencySearch] = useState("");
|
|
1114
|
+
const debouncedCurrency = useDebounce$2(currencySearch, 300);
|
|
1115
|
+
const [dateFrom, setDateFrom] = useState("");
|
|
1116
|
+
const [dateTo, setDateTo] = useState("");
|
|
1117
|
+
const [amountMin, setAmountMin] = useState("");
|
|
1118
|
+
const [amountMax, setAmountMax] = useState("");
|
|
1123
1119
|
const [isLoading, setIsLoading] = useState(true);
|
|
1124
1120
|
const [isFetchingMore, setIsFetchingMore] = useState(false);
|
|
1125
1121
|
const [error, setError] = useState(null);
|
|
1126
1122
|
const [offset, setOffset] = useState(0);
|
|
1127
1123
|
const [count, setCount] = useState(0);
|
|
1128
1124
|
const limit = 50;
|
|
1129
|
-
const
|
|
1130
|
-
async (nextOffset, replace
|
|
1131
|
-
var _a;
|
|
1125
|
+
const loadRefunds = useCallback(
|
|
1126
|
+
async (nextOffset, replace) => {
|
|
1132
1127
|
try {
|
|
1133
|
-
if (replace)
|
|
1134
|
-
|
|
1135
|
-
} else {
|
|
1136
|
-
setIsFetchingMore(true);
|
|
1137
|
-
}
|
|
1128
|
+
if (replace) setIsLoading(true);
|
|
1129
|
+
else setIsFetchingMore(true);
|
|
1138
1130
|
setError(null);
|
|
1139
1131
|
const params = new URLSearchParams();
|
|
1140
1132
|
params.set("limit", String(limit));
|
|
1141
1133
|
params.set("offset", String(nextOffset));
|
|
1142
|
-
if (
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
if (
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
params.set("
|
|
1152
|
-
const response = await fetch(
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
);
|
|
1134
|
+
if (debouncedOrderId.trim()) params.set("order_id", debouncedOrderId.trim());
|
|
1135
|
+
if (paymentStatusFilter !== "all") params.set("payment_status", paymentStatusFilter);
|
|
1136
|
+
if (debouncedProvider.trim()) params.set("provider_id", debouncedProvider.trim());
|
|
1137
|
+
if (debouncedCurrency.trim()) params.set("currency_code", debouncedCurrency.trim());
|
|
1138
|
+
if (dateFrom.trim()) params.set("date_from", dateFrom.trim());
|
|
1139
|
+
if (dateTo.trim()) params.set("date_to", dateTo.trim());
|
|
1140
|
+
const min = amountMin.trim() ? Number(amountMin) : void 0;
|
|
1141
|
+
const max = amountMax.trim() ? Number(amountMax) : void 0;
|
|
1142
|
+
if (min != null && !Number.isNaN(min)) params.set("amount_min", String(min));
|
|
1143
|
+
if (max != null && !Number.isNaN(max)) params.set("amount_max", String(max));
|
|
1144
|
+
const response = await fetch(`/admin/refunds?${params.toString()}`, {
|
|
1145
|
+
credentials: "include"
|
|
1146
|
+
});
|
|
1156
1147
|
if (!response.ok) {
|
|
1157
|
-
const
|
|
1158
|
-
throw new Error(
|
|
1148
|
+
const text = await response.text();
|
|
1149
|
+
throw new Error(text || "Failed to load refunds");
|
|
1159
1150
|
}
|
|
1160
1151
|
const payload = await response.json();
|
|
1152
|
+
const list = payload.refunds ?? [];
|
|
1161
1153
|
setCount(payload.count ?? 0);
|
|
1162
|
-
setOffset(nextOffset +
|
|
1163
|
-
setItems(
|
|
1164
|
-
|
|
1165
|
-
);
|
|
1166
|
-
} catch (loadError) {
|
|
1167
|
-
const message = loadError instanceof Error ? loadError.message : "Unable to load return orders";
|
|
1168
|
-
setError(message);
|
|
1154
|
+
setOffset(nextOffset + list.length);
|
|
1155
|
+
setItems((prev) => replace ? list : [...prev, ...list]);
|
|
1156
|
+
} catch (e) {
|
|
1157
|
+
setError(e instanceof Error ? e.message : "Failed to load");
|
|
1169
1158
|
} finally {
|
|
1170
1159
|
setIsLoading(false);
|
|
1171
1160
|
setIsFetchingMore(false);
|
|
1172
1161
|
}
|
|
1173
1162
|
},
|
|
1174
|
-
[
|
|
1163
|
+
[
|
|
1164
|
+
debouncedOrderId,
|
|
1165
|
+
paymentStatusFilter,
|
|
1166
|
+
debouncedProvider,
|
|
1167
|
+
debouncedCurrency,
|
|
1168
|
+
dateFrom,
|
|
1169
|
+
dateTo,
|
|
1170
|
+
amountMin,
|
|
1171
|
+
amountMax
|
|
1172
|
+
]
|
|
1175
1173
|
);
|
|
1176
1174
|
useEffect(() => {
|
|
1177
|
-
void
|
|
1178
|
-
}, [
|
|
1175
|
+
void loadRefunds(0, true);
|
|
1176
|
+
}, [loadRefunds]);
|
|
1179
1177
|
const hasMore = useMemo(() => offset < count, [offset, count]);
|
|
1180
|
-
const
|
|
1181
|
-
const
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1178
|
+
const displayAmount = (r) => {
|
|
1179
|
+
const code = (r.currency_code ?? "USD").toUpperCase();
|
|
1180
|
+
return `${code} ${Number(r.amount)}`;
|
|
1181
|
+
};
|
|
1182
|
+
const displayStatus = (r) => {
|
|
1183
|
+
const s2 = r.payment_status ?? "";
|
|
1184
|
+
return s2 !== "" ? s2 : "—";
|
|
1185
|
+
};
|
|
1185
1186
|
return /* @__PURE__ */ jsx("div", { className: "w-full p-6", children: /* @__PURE__ */ jsxs(Container, { className: "mx-auto flex w-full max-w-7xl flex-col gap-6 p-6", children: [
|
|
1186
1187
|
/* @__PURE__ */ jsxs("header", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
1187
1188
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
1188
|
-
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "
|
|
1189
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "
|
|
1189
|
+
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "Refunds" }),
|
|
1190
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Refund records — amount, order, payment status" })
|
|
1190
1191
|
] }),
|
|
1191
|
-
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () =>
|
|
1192
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () => loadRefunds(0, true), children: "Refresh" })
|
|
1192
1193
|
] }),
|
|
1193
|
-
/* @__PURE__ */
|
|
1194
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
1194
1195
|
/* @__PURE__ */ jsx(
|
|
1195
1196
|
Input,
|
|
1196
1197
|
{
|
|
1197
|
-
placeholder: "
|
|
1198
|
-
value:
|
|
1199
|
-
onChange: (
|
|
1200
|
-
className: "md:max-w-
|
|
1198
|
+
placeholder: "Order ID",
|
|
1199
|
+
value: orderIdSearch,
|
|
1200
|
+
onChange: (e) => setOrderIdSearch(e.target.value),
|
|
1201
|
+
className: "md:max-w-[180px]",
|
|
1202
|
+
"aria-label": "Filter by order ID"
|
|
1201
1203
|
}
|
|
1202
1204
|
),
|
|
1203
|
-
/* @__PURE__ */
|
|
1204
|
-
|
|
1205
|
-
"select",
|
|
1206
|
-
{
|
|
1207
|
-
value: createdByFilter,
|
|
1208
|
-
onChange: (event) => setCreatedByFilter(event.target.value),
|
|
1209
|
-
className: "h-9 rounded-md border border-ui-border-base bg-transparent px-3 text-sm text-ui-fg-base outline-none transition focus:ring-2 focus:ring-ui-fg-interactive md:max-w-xs",
|
|
1210
|
-
children: [
|
|
1211
|
-
/* @__PURE__ */ jsx("option", { value: "all", children: "All (Created by)" }),
|
|
1212
|
-
/* @__PURE__ */ jsx("option", { value: "customer", children: "Customer" }),
|
|
1213
|
-
/* @__PURE__ */ jsx("option", { value: "admin", children: "Admin" })
|
|
1214
|
-
]
|
|
1215
|
-
}
|
|
1216
|
-
),
|
|
1217
|
-
/* @__PURE__ */ jsxs(
|
|
1218
|
-
"select",
|
|
1219
|
-
{
|
|
1220
|
-
value: statusFilter,
|
|
1221
|
-
onChange: (event) => setStatusFilter(event.target.value),
|
|
1222
|
-
className: "h-9 rounded-md border border-ui-border-base bg-transparent px-3 text-sm text-ui-fg-base outline-none transition focus:ring-2 focus:ring-ui-fg-interactive md:max-w-xs",
|
|
1223
|
-
children: [
|
|
1224
|
-
/* @__PURE__ */ jsx("option", { value: "all", children: "All Statuses" }),
|
|
1225
|
-
availableStatuses.map((status) => /* @__PURE__ */ jsx("option", { value: status, children: status.replace(/_/g, " ").toUpperCase() }, status))
|
|
1226
|
-
]
|
|
1227
|
-
}
|
|
1228
|
-
)
|
|
1229
|
-
] })
|
|
1230
|
-
] }),
|
|
1231
|
-
error ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-strong p-6 text-center", children: [
|
|
1232
|
-
/* @__PURE__ */ jsx(Text, { weight: "plus", className: "text-ui-fg-error", children: error }),
|
|
1233
|
-
/* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx(
|
|
1234
|
-
Button,
|
|
1205
|
+
/* @__PURE__ */ jsx(
|
|
1206
|
+
Input,
|
|
1235
1207
|
{
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1208
|
+
placeholder: "Provider",
|
|
1209
|
+
value: providerSearch,
|
|
1210
|
+
onChange: (e) => setProviderSearch(e.target.value),
|
|
1211
|
+
className: "md:max-w-[140px]",
|
|
1212
|
+
"aria-label": "Filter by provider"
|
|
1239
1213
|
}
|
|
1240
|
-
)
|
|
1214
|
+
),
|
|
1215
|
+
/* @__PURE__ */ jsx(
|
|
1216
|
+
Input,
|
|
1217
|
+
{
|
|
1218
|
+
placeholder: "Currency",
|
|
1219
|
+
value: currencySearch,
|
|
1220
|
+
onChange: (e) => setCurrencySearch(e.target.value),
|
|
1221
|
+
className: "md:max-w-[100px]",
|
|
1222
|
+
"aria-label": "Filter by currency"
|
|
1223
|
+
}
|
|
1224
|
+
),
|
|
1225
|
+
/* @__PURE__ */ jsxs(
|
|
1226
|
+
"select",
|
|
1227
|
+
{
|
|
1228
|
+
value: paymentStatusFilter,
|
|
1229
|
+
onChange: (e) => setPaymentStatusFilter(e.target.value),
|
|
1230
|
+
className: "h-9 rounded-md border border-ui-border-base bg-transparent px-3 text-sm text-ui-fg-base outline-none transition focus:ring-2 focus:ring-ui-fg-interactive md:max-w-[160px]",
|
|
1231
|
+
"aria-label": "Filter by payment status",
|
|
1232
|
+
children: [
|
|
1233
|
+
/* @__PURE__ */ jsx("option", { value: "all", children: "All statuses" }),
|
|
1234
|
+
/* @__PURE__ */ jsx("option", { value: "pending", children: "Pending" }),
|
|
1235
|
+
/* @__PURE__ */ jsx("option", { value: "requires_more", children: "Requires more" }),
|
|
1236
|
+
/* @__PURE__ */ jsx("option", { value: "error", children: "Error" }),
|
|
1237
|
+
/* @__PURE__ */ jsx("option", { value: "canceled", children: "Canceled" }),
|
|
1238
|
+
/* @__PURE__ */ jsx("option", { value: "authorized", children: "Authorized" }),
|
|
1239
|
+
/* @__PURE__ */ jsx("option", { value: "captured", children: "Captured" })
|
|
1240
|
+
]
|
|
1241
|
+
}
|
|
1242
|
+
),
|
|
1243
|
+
/* @__PURE__ */ jsx(
|
|
1244
|
+
Input,
|
|
1245
|
+
{
|
|
1246
|
+
type: "date",
|
|
1247
|
+
placeholder: "From",
|
|
1248
|
+
value: dateFrom,
|
|
1249
|
+
onChange: (e) => setDateFrom(e.target.value),
|
|
1250
|
+
className: "md:max-w-[140px]",
|
|
1251
|
+
"aria-label": "Date from"
|
|
1252
|
+
}
|
|
1253
|
+
),
|
|
1254
|
+
/* @__PURE__ */ jsx(
|
|
1255
|
+
Input,
|
|
1256
|
+
{
|
|
1257
|
+
type: "date",
|
|
1258
|
+
placeholder: "To",
|
|
1259
|
+
value: dateTo,
|
|
1260
|
+
onChange: (e) => setDateTo(e.target.value),
|
|
1261
|
+
className: "md:max-w-[140px]",
|
|
1262
|
+
"aria-label": "Date to"
|
|
1263
|
+
}
|
|
1264
|
+
),
|
|
1265
|
+
/* @__PURE__ */ jsx(
|
|
1266
|
+
Input,
|
|
1267
|
+
{
|
|
1268
|
+
placeholder: "Amount min",
|
|
1269
|
+
value: amountMin,
|
|
1270
|
+
onChange: (e) => setAmountMin(e.target.value),
|
|
1271
|
+
type: "number",
|
|
1272
|
+
min: 0,
|
|
1273
|
+
className: "md:max-w-[100px]",
|
|
1274
|
+
"aria-label": "Refund amount minimum"
|
|
1275
|
+
}
|
|
1276
|
+
),
|
|
1277
|
+
/* @__PURE__ */ jsx(
|
|
1278
|
+
Input,
|
|
1279
|
+
{
|
|
1280
|
+
placeholder: "Amount max",
|
|
1281
|
+
value: amountMax,
|
|
1282
|
+
onChange: (e) => setAmountMax(e.target.value),
|
|
1283
|
+
type: "number",
|
|
1284
|
+
min: 0,
|
|
1285
|
+
className: "md:max-w-[100px]",
|
|
1286
|
+
"aria-label": "Refund amount maximum"
|
|
1287
|
+
}
|
|
1288
|
+
)
|
|
1289
|
+
] }) }),
|
|
1290
|
+
error ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-strong p-6 text-center", children: [
|
|
1291
|
+
/* @__PURE__ */ jsx(Text, { weight: "plus", className: "text-ui-fg-error", children: error }),
|
|
1292
|
+
/* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: () => loadRefunds(0, true), children: "Try again" }) })
|
|
1241
1293
|
] }) : null,
|
|
1242
|
-
isLoading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading
|
|
1243
|
-
/* @__PURE__ */ jsx(Heading, { level: "h3", className: "text-xl", children: "No
|
|
1244
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "mt-2 text-ui-fg-subtle", children: "
|
|
1245
|
-
] }) : /* @__PURE__ */ jsx("div", { className: "overflow-
|
|
1294
|
+
isLoading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading refunds…" }) }) : items.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-dashed border-ui-border-strong p-10 text-center", children: [
|
|
1295
|
+
/* @__PURE__ */ jsx(Heading, { level: "h3", className: "text-xl", children: "No refunds yet" }),
|
|
1296
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "mt-2 text-ui-fg-subtle", children: "Refund records will appear here." })
|
|
1297
|
+
] }) : /* @__PURE__ */ jsx("div", { className: "w-full overflow-x-auto rounded-xl border border-ui-border-base", children: /* @__PURE__ */ jsxs("table", { className: "w-full table-fixed divide-y divide-ui-border-base", style: { minWidth: 0 }, children: [
|
|
1246
1298
|
/* @__PURE__ */ jsx("thead", { className: "bg-ui-bg-subtle", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
1247
|
-
/* @__PURE__ */ jsx("th", { className: "px-
|
|
1248
|
-
/* @__PURE__ */ jsx("th", { className: "px-
|
|
1249
|
-
/* @__PURE__ */ jsx("th", { className: "px-
|
|
1250
|
-
/* @__PURE__ */ jsx("th", { className: "px-
|
|
1251
|
-
/* @__PURE__ */ jsx("th", { className: "px-
|
|
1252
|
-
/* @__PURE__ */ jsx("th", { className: "px-
|
|
1253
|
-
/* @__PURE__ */ jsx("th", { className: "px-
|
|
1299
|
+
/* @__PURE__ */ jsx("th", { className: "w-[11%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Refund ID" }),
|
|
1300
|
+
/* @__PURE__ */ jsx("th", { className: "w-[11%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Order ID" }),
|
|
1301
|
+
/* @__PURE__ */ jsx("th", { className: "w-[11%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Payment ID" }),
|
|
1302
|
+
/* @__PURE__ */ jsx("th", { className: "w-[8%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Amount" }),
|
|
1303
|
+
/* @__PURE__ */ jsx("th", { className: "w-[6%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Currency" }),
|
|
1304
|
+
/* @__PURE__ */ jsx("th", { className: "w-[10%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Provider" }),
|
|
1305
|
+
/* @__PURE__ */ jsx("th", { className: "w-[10%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Payment Status" }),
|
|
1306
|
+
/* @__PURE__ */ jsx("th", { className: "w-[14%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Note" }),
|
|
1307
|
+
/* @__PURE__ */ jsx("th", { className: "w-[11%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Created" }),
|
|
1308
|
+
/* @__PURE__ */ jsx("th", { className: "w-[8%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Actions" })
|
|
1254
1309
|
] }) }),
|
|
1255
|
-
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-ui-border-subtle", children: items.map((
|
|
1310
|
+
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-ui-border-subtle", children: items.map((r) => /* @__PURE__ */ jsxs(
|
|
1256
1311
|
"tr",
|
|
1257
1312
|
{
|
|
1258
|
-
className: "hover:bg-ui-bg-subtle/60
|
|
1259
|
-
onClick: () => navigate(`/
|
|
1313
|
+
className: "cursor-pointer hover:bg-ui-bg-subtle/60",
|
|
1314
|
+
onClick: () => navigate(`/refunds/${r.refund_id}`),
|
|
1260
1315
|
children: [
|
|
1261
|
-
/* @__PURE__ */ jsx("td", { className: "px-
|
|
1262
|
-
/* @__PURE__ */ jsx("td", { className: "px-
|
|
1263
|
-
/* @__PURE__ */ jsx("td", { className: "px-
|
|
1264
|
-
/* @__PURE__ */ jsx("td", { className: "px-
|
|
1316
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 font-mono text-sm text-ui-fg-base", title: r.refund_id, children: r.refund_id }),
|
|
1317
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 font-medium text-ui-fg-base", title: r.order_id ?? void 0, children: r.order_id ?? "—" }),
|
|
1318
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 font-mono text-sm text-ui-fg-subtle", title: r.payment_id, children: r.payment_id }),
|
|
1319
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 text-ui-fg-subtle", children: displayAmount(r) }),
|
|
1320
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 text-ui-fg-subtle uppercase", children: r.currency_code || "—" }),
|
|
1321
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 text-ui-fg-subtle", title: r.provider_id || void 0, children: r.provider_id || "—" }),
|
|
1322
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 px-3 py-3", children: /* @__PURE__ */ jsx(
|
|
1265
1323
|
Badge,
|
|
1266
1324
|
{
|
|
1267
1325
|
size: "2xsmall",
|
|
1268
|
-
className: `uppercase ${getStatusBadgeClass$6(
|
|
1269
|
-
children:
|
|
1326
|
+
className: `uppercase ${getStatusBadgeClass$6(displayStatus(r))}`,
|
|
1327
|
+
children: displayStatus(r) !== "—" ? displayStatus(r).replace(/_/g, " ") : "—"
|
|
1270
1328
|
}
|
|
1271
1329
|
) }),
|
|
1272
|
-
/* @__PURE__ */ jsx("td", { className: "px-
|
|
1273
|
-
|
|
1274
|
-
if (amount == null || amount === void 0) {
|
|
1275
|
-
return "—";
|
|
1276
|
-
}
|
|
1277
|
-
const displayAmount = Number(amount) / 100;
|
|
1278
|
-
const currency = returnOrder.currency_code || "$";
|
|
1279
|
-
return `${currency}${displayAmount.toFixed(2)}`;
|
|
1280
|
-
})() }),
|
|
1281
|
-
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: new Date(returnOrder.created_at).toLocaleDateString("en-US", {
|
|
1282
|
-
year: "numeric",
|
|
1330
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 text-ui-fg-subtle", title: r.note ?? void 0, children: r.note ?? "—" }),
|
|
1331
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 text-ui-fg-subtle text-xs", children: new Date(r.created_at).toLocaleDateString("en-US", {
|
|
1283
1332
|
month: "short",
|
|
1284
1333
|
day: "numeric",
|
|
1285
1334
|
hour: "numeric",
|
|
1286
1335
|
minute: "2-digit",
|
|
1287
1336
|
hour12: true
|
|
1288
1337
|
}) }),
|
|
1289
|
-
/* @__PURE__ */ jsx("td", { className: "px-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
e
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1338
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 px-3 py-3", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-1", children: [
|
|
1339
|
+
/* @__PURE__ */ jsx(
|
|
1340
|
+
Button,
|
|
1341
|
+
{
|
|
1342
|
+
variant: "transparent",
|
|
1343
|
+
size: "small",
|
|
1344
|
+
onClick: (e) => {
|
|
1345
|
+
e.stopPropagation();
|
|
1346
|
+
navigate(`/refunds/${r.refund_id}`);
|
|
1347
|
+
},
|
|
1348
|
+
children: "Details"
|
|
1349
|
+
}
|
|
1350
|
+
),
|
|
1351
|
+
r.order_id ? /* @__PURE__ */ jsx(
|
|
1352
|
+
Button,
|
|
1353
|
+
{
|
|
1354
|
+
variant: "transparent",
|
|
1355
|
+
size: "small",
|
|
1356
|
+
onClick: (e) => {
|
|
1357
|
+
e.stopPropagation();
|
|
1358
|
+
navigate(`/orders/${r.order_id}`);
|
|
1359
|
+
},
|
|
1360
|
+
children: "Order"
|
|
1361
|
+
}
|
|
1362
|
+
) : null
|
|
1363
|
+
] }) })
|
|
1301
1364
|
]
|
|
1302
1365
|
},
|
|
1303
|
-
|
|
1366
|
+
r.refund_id
|
|
1304
1367
|
)) })
|
|
1305
1368
|
] }) }),
|
|
1306
1369
|
hasMore ? /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx(
|
|
@@ -1308,15 +1371,15 @@ const ReturnsPage = () => {
|
|
|
1308
1371
|
{
|
|
1309
1372
|
variant: "secondary",
|
|
1310
1373
|
isLoading: isFetchingMore,
|
|
1311
|
-
onClick: () =>
|
|
1374
|
+
onClick: () => loadRefunds(offset, false),
|
|
1312
1375
|
children: "Load more"
|
|
1313
1376
|
}
|
|
1314
1377
|
) }) : null
|
|
1315
1378
|
] }) });
|
|
1316
1379
|
};
|
|
1317
1380
|
const config$6 = defineRouteConfig({
|
|
1318
|
-
label: "
|
|
1319
|
-
icon:
|
|
1381
|
+
label: "Refunds",
|
|
1382
|
+
icon: Receipt
|
|
1320
1383
|
});
|
|
1321
1384
|
const useDebounce$1 = (value, delay) => {
|
|
1322
1385
|
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
@@ -1327,144 +1390,190 @@ const useDebounce$1 = (value, delay) => {
|
|
|
1327
1390
|
return debouncedValue;
|
|
1328
1391
|
};
|
|
1329
1392
|
const getStatusBadgeClass$5 = (status) => {
|
|
1330
|
-
const
|
|
1331
|
-
if (
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
if (
|
|
1393
|
+
const statusLower = status.toLowerCase();
|
|
1394
|
+
if (statusLower === "requested") {
|
|
1395
|
+
return "bg-ui-tag-orange-bg text-ui-tag-orange-text";
|
|
1396
|
+
}
|
|
1397
|
+
if (statusLower === "received") {
|
|
1398
|
+
return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
1399
|
+
}
|
|
1400
|
+
if (statusLower === "requires_action") {
|
|
1401
|
+
return "bg-ui-tag-red-bg text-ui-tag-red-text";
|
|
1402
|
+
}
|
|
1403
|
+
if (statusLower === "completed") {
|
|
1404
|
+
return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
1405
|
+
}
|
|
1406
|
+
if (statusLower === "canceled") {
|
|
1407
|
+
return "bg-ui-tag-grey-bg text-ui-tag-grey-text";
|
|
1408
|
+
}
|
|
1335
1409
|
return "bg-ui-tag-purple-bg text-ui-tag-purple-text";
|
|
1336
1410
|
};
|
|
1337
|
-
const
|
|
1411
|
+
const ReturnsPage = () => {
|
|
1338
1412
|
const navigate = useNavigate();
|
|
1339
1413
|
const [items, setItems] = useState([]);
|
|
1340
1414
|
const [statusFilter, setStatusFilter] = useState("all");
|
|
1341
|
-
const [
|
|
1342
|
-
const
|
|
1415
|
+
const [createdByFilter, setCreatedByFilter] = useState("all");
|
|
1416
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
1417
|
+
const debouncedSearchQuery = useDebounce$1(searchQuery, 300);
|
|
1343
1418
|
const [isLoading, setIsLoading] = useState(true);
|
|
1344
1419
|
const [isFetchingMore, setIsFetchingMore] = useState(false);
|
|
1345
1420
|
const [error, setError] = useState(null);
|
|
1346
1421
|
const [offset, setOffset] = useState(0);
|
|
1347
1422
|
const [count, setCount] = useState(0);
|
|
1348
1423
|
const limit = 50;
|
|
1349
|
-
const
|
|
1350
|
-
async (nextOffset, replace) => {
|
|
1424
|
+
const loadReturns = useCallback(
|
|
1425
|
+
async (nextOffset, replace = false) => {
|
|
1426
|
+
var _a;
|
|
1351
1427
|
try {
|
|
1352
|
-
if (replace)
|
|
1353
|
-
|
|
1428
|
+
if (replace) {
|
|
1429
|
+
setIsLoading(true);
|
|
1430
|
+
} else {
|
|
1431
|
+
setIsFetchingMore(true);
|
|
1432
|
+
}
|
|
1354
1433
|
setError(null);
|
|
1355
1434
|
const params = new URLSearchParams();
|
|
1356
1435
|
params.set("limit", String(limit));
|
|
1357
1436
|
params.set("offset", String(nextOffset));
|
|
1358
|
-
if (statusFilter !== "all")
|
|
1359
|
-
|
|
1437
|
+
if (statusFilter !== "all") {
|
|
1438
|
+
params.set("status", statusFilter);
|
|
1439
|
+
}
|
|
1440
|
+
if (debouncedSearchQuery.trim()) {
|
|
1441
|
+
params.set("q", debouncedSearchQuery.trim());
|
|
1442
|
+
}
|
|
1443
|
+
if (createdByFilter !== "all") {
|
|
1444
|
+
params.set("created_by", createdByFilter);
|
|
1445
|
+
}
|
|
1446
|
+
params.set("order", "created_at");
|
|
1360
1447
|
const response = await fetch(
|
|
1361
|
-
`/admin/
|
|
1448
|
+
`/admin/return?${params.toString()}`,
|
|
1362
1449
|
{ credentials: "include" }
|
|
1363
1450
|
);
|
|
1364
1451
|
if (!response.ok) {
|
|
1365
|
-
const
|
|
1366
|
-
throw new Error(
|
|
1452
|
+
const message = await response.text();
|
|
1453
|
+
throw new Error(message || "Unable to load return orders");
|
|
1367
1454
|
}
|
|
1368
1455
|
const payload = await response.json();
|
|
1369
|
-
const list = payload.transactions ?? [];
|
|
1370
1456
|
setCount(payload.count ?? 0);
|
|
1371
|
-
setOffset(nextOffset +
|
|
1372
|
-
setItems(
|
|
1373
|
-
|
|
1374
|
-
|
|
1457
|
+
setOffset(nextOffset + (((_a = payload.returns) == null ? void 0 : _a.length) ?? 0));
|
|
1458
|
+
setItems(
|
|
1459
|
+
(prev) => replace ? payload.returns ?? [] : [...prev, ...payload.returns ?? []]
|
|
1460
|
+
);
|
|
1461
|
+
} catch (loadError) {
|
|
1462
|
+
const message = loadError instanceof Error ? loadError.message : "Unable to load return orders";
|
|
1463
|
+
setError(message);
|
|
1375
1464
|
} finally {
|
|
1376
1465
|
setIsLoading(false);
|
|
1377
1466
|
setIsFetchingMore(false);
|
|
1378
1467
|
}
|
|
1379
1468
|
},
|
|
1380
|
-
[statusFilter,
|
|
1469
|
+
[statusFilter, createdByFilter, debouncedSearchQuery]
|
|
1381
1470
|
);
|
|
1382
1471
|
useEffect(() => {
|
|
1383
|
-
void
|
|
1384
|
-
}, [
|
|
1472
|
+
void loadReturns(0, true);
|
|
1473
|
+
}, [statusFilter, createdByFilter, debouncedSearchQuery, loadReturns]);
|
|
1385
1474
|
const hasMore = useMemo(() => offset < count, [offset, count]);
|
|
1386
|
-
const
|
|
1387
|
-
const
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
const code = (t.currency_code ?? "USD").toUpperCase();
|
|
1392
|
-
return `${code} ${Number(t.amount)}`;
|
|
1393
|
-
};
|
|
1475
|
+
const availableStatuses = useMemo(() => {
|
|
1476
|
+
const statuses = /* @__PURE__ */ new Set();
|
|
1477
|
+
items.forEach((item) => statuses.add(item.status));
|
|
1478
|
+
return Array.from(statuses).sort();
|
|
1479
|
+
}, [items]);
|
|
1394
1480
|
return /* @__PURE__ */ jsx("div", { className: "w-full p-6", children: /* @__PURE__ */ jsxs(Container, { className: "mx-auto flex w-full max-w-7xl flex-col gap-6 p-6", children: [
|
|
1395
1481
|
/* @__PURE__ */ jsxs("header", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
1396
1482
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
1397
|
-
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "
|
|
1398
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "
|
|
1483
|
+
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "Return Orders" }),
|
|
1484
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "View and manage all customer return orders" })
|
|
1399
1485
|
] }),
|
|
1400
|
-
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () =>
|
|
1486
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () => loadReturns(0, true), children: "Refresh" })
|
|
1401
1487
|
] }),
|
|
1402
1488
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
1403
1489
|
/* @__PURE__ */ jsx(
|
|
1404
1490
|
Input,
|
|
1405
1491
|
{
|
|
1406
|
-
placeholder: "Search by
|
|
1407
|
-
value:
|
|
1408
|
-
onChange: (
|
|
1409
|
-
className: "md:max-w-sm"
|
|
1410
|
-
"aria-label": "Search by order ID"
|
|
1492
|
+
placeholder: "Search by return ID, order ID, or customer email",
|
|
1493
|
+
value: searchQuery,
|
|
1494
|
+
onChange: (event) => setSearchQuery(event.target.value),
|
|
1495
|
+
className: "md:max-w-sm"
|
|
1411
1496
|
}
|
|
1412
1497
|
),
|
|
1413
|
-
/* @__PURE__ */
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1498
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
1499
|
+
/* @__PURE__ */ jsxs(
|
|
1500
|
+
"select",
|
|
1501
|
+
{
|
|
1502
|
+
value: createdByFilter,
|
|
1503
|
+
onChange: (event) => setCreatedByFilter(event.target.value),
|
|
1504
|
+
className: "h-9 rounded-md border border-ui-border-base bg-transparent px-3 text-sm text-ui-fg-base outline-none transition focus:ring-2 focus:ring-ui-fg-interactive md:max-w-xs",
|
|
1505
|
+
children: [
|
|
1506
|
+
/* @__PURE__ */ jsx("option", { value: "all", children: "All (Created by)" }),
|
|
1507
|
+
/* @__PURE__ */ jsx("option", { value: "customer", children: "Customer" }),
|
|
1508
|
+
/* @__PURE__ */ jsx("option", { value: "admin", children: "Admin" })
|
|
1509
|
+
]
|
|
1510
|
+
}
|
|
1511
|
+
),
|
|
1512
|
+
/* @__PURE__ */ jsxs(
|
|
1513
|
+
"select",
|
|
1514
|
+
{
|
|
1515
|
+
value: statusFilter,
|
|
1516
|
+
onChange: (event) => setStatusFilter(event.target.value),
|
|
1517
|
+
className: "h-9 rounded-md border border-ui-border-base bg-transparent px-3 text-sm text-ui-fg-base outline-none transition focus:ring-2 focus:ring-ui-fg-interactive md:max-w-xs",
|
|
1518
|
+
children: [
|
|
1519
|
+
/* @__PURE__ */ jsx("option", { value: "all", children: "All Statuses" }),
|
|
1520
|
+
availableStatuses.map((status) => /* @__PURE__ */ jsx("option", { value: status, children: status.replace(/_/g, " ").toUpperCase() }, status))
|
|
1521
|
+
]
|
|
1522
|
+
}
|
|
1523
|
+
)
|
|
1524
|
+
] })
|
|
1431
1525
|
] }),
|
|
1432
1526
|
error ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-strong p-6 text-center", children: [
|
|
1433
1527
|
/* @__PURE__ */ jsx(Text, { weight: "plus", className: "text-ui-fg-error", children: error }),
|
|
1434
|
-
/* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx(
|
|
1528
|
+
/* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx(
|
|
1529
|
+
Button,
|
|
1530
|
+
{
|
|
1531
|
+
variant: "secondary",
|
|
1532
|
+
onClick: () => loadReturns(0, true),
|
|
1533
|
+
children: "Try again"
|
|
1534
|
+
}
|
|
1535
|
+
) })
|
|
1435
1536
|
] }) : null,
|
|
1436
|
-
isLoading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading
|
|
1437
|
-
/* @__PURE__ */ jsx(Heading, { level: "h3", className: "text-xl", children: "No
|
|
1438
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "mt-2 text-ui-fg-subtle", children: "
|
|
1537
|
+
isLoading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading return orders..." }) }) : items.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-dashed border-ui-border-strong p-10 text-center", children: [
|
|
1538
|
+
/* @__PURE__ */ jsx(Heading, { level: "h3", className: "text-xl", children: "No return orders yet" }),
|
|
1539
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "mt-2 text-ui-fg-subtle", children: "Return orders created by customers will appear here." })
|
|
1439
1540
|
] }) : /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-xl border border-ui-border-base", children: /* @__PURE__ */ jsxs("table", { className: "min-w-full divide-y divide-ui-border-base", children: [
|
|
1440
1541
|
/* @__PURE__ */ jsx("thead", { className: "bg-ui-bg-subtle", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
1542
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Return ID" }),
|
|
1441
1543
|
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Order ID" }),
|
|
1442
|
-
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "
|
|
1443
|
-
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Provider" }),
|
|
1544
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Customer" }),
|
|
1444
1545
|
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Status" }),
|
|
1445
|
-
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "
|
|
1546
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Refund Amount" }),
|
|
1446
1547
|
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Created" }),
|
|
1447
1548
|
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Actions" })
|
|
1448
1549
|
] }) }),
|
|
1449
|
-
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-ui-border-subtle", children: items.map((
|
|
1550
|
+
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-ui-border-subtle", children: items.map((returnOrder) => /* @__PURE__ */ jsxs(
|
|
1450
1551
|
"tr",
|
|
1451
1552
|
{
|
|
1452
1553
|
className: "hover:bg-ui-bg-subtle/60 cursor-pointer",
|
|
1453
|
-
onClick: () => navigate(`/
|
|
1554
|
+
onClick: () => navigate(`/returns/${returnOrder.id}`),
|
|
1454
1555
|
children: [
|
|
1455
|
-
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 font-medium text-ui-fg-base", children:
|
|
1456
|
-
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children:
|
|
1457
|
-
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children:
|
|
1556
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 font-medium text-ui-fg-base", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-0.5", children: /* @__PURE__ */ jsx("span", { children: returnOrder.id }) }) }),
|
|
1557
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: returnOrder.order_id }),
|
|
1558
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: returnOrder.customer_email || returnOrder.order_email || "—" }),
|
|
1458
1559
|
/* @__PURE__ */ jsx("td", { className: "px-4 py-4", children: /* @__PURE__ */ jsx(
|
|
1459
1560
|
Badge,
|
|
1460
1561
|
{
|
|
1461
1562
|
size: "2xsmall",
|
|
1462
|
-
className: `uppercase ${getStatusBadgeClass$5(
|
|
1463
|
-
children:
|
|
1563
|
+
className: `uppercase ${getStatusBadgeClass$5(returnOrder.status)}`,
|
|
1564
|
+
children: returnOrder.status.replace(/_/g, " ")
|
|
1464
1565
|
}
|
|
1465
1566
|
) }),
|
|
1466
|
-
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children:
|
|
1467
|
-
|
|
1567
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: (() => {
|
|
1568
|
+
const amount = returnOrder.refund_amount;
|
|
1569
|
+
if (amount == null || amount === void 0) {
|
|
1570
|
+
return "—";
|
|
1571
|
+
}
|
|
1572
|
+
const displayAmount = Number(amount) / 100;
|
|
1573
|
+
const currency = returnOrder.currency_code || "$";
|
|
1574
|
+
return `${currency}${displayAmount.toFixed(2)}`;
|
|
1575
|
+
})() }),
|
|
1576
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: new Date(returnOrder.created_at).toLocaleDateString("en-US", {
|
|
1468
1577
|
year: "numeric",
|
|
1469
1578
|
month: "short",
|
|
1470
1579
|
day: "numeric",
|
|
@@ -1472,35 +1581,21 @@ const PaymentsPage = () => {
|
|
|
1472
1581
|
minute: "2-digit",
|
|
1473
1582
|
hour12: true
|
|
1474
1583
|
}) }),
|
|
1475
|
-
/* @__PURE__ */
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
),
|
|
1488
|
-
t.order_id ? /* @__PURE__ */ jsx(
|
|
1489
|
-
Button,
|
|
1490
|
-
{
|
|
1491
|
-
variant: "transparent",
|
|
1492
|
-
size: "small",
|
|
1493
|
-
onClick: (e) => {
|
|
1494
|
-
e.stopPropagation();
|
|
1495
|
-
navigate(`/orders/${t.order_id}`);
|
|
1496
|
-
},
|
|
1497
|
-
children: "Order"
|
|
1498
|
-
}
|
|
1499
|
-
) : null
|
|
1500
|
-
] })
|
|
1584
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4", children: /* @__PURE__ */ jsx(
|
|
1585
|
+
Button,
|
|
1586
|
+
{
|
|
1587
|
+
variant: "transparent",
|
|
1588
|
+
size: "small",
|
|
1589
|
+
onClick: (e) => {
|
|
1590
|
+
e.stopPropagation();
|
|
1591
|
+
navigate(`/app/orders/${returnOrder.order_id}`);
|
|
1592
|
+
},
|
|
1593
|
+
children: "Go to order"
|
|
1594
|
+
}
|
|
1595
|
+
) })
|
|
1501
1596
|
]
|
|
1502
1597
|
},
|
|
1503
|
-
|
|
1598
|
+
returnOrder.id
|
|
1504
1599
|
)) })
|
|
1505
1600
|
] }) }),
|
|
1506
1601
|
hasMore ? /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx(
|
|
@@ -1508,15 +1603,15 @@ const PaymentsPage = () => {
|
|
|
1508
1603
|
{
|
|
1509
1604
|
variant: "secondary",
|
|
1510
1605
|
isLoading: isFetchingMore,
|
|
1511
|
-
onClick: () =>
|
|
1606
|
+
onClick: () => loadReturns(offset, false),
|
|
1512
1607
|
children: "Load more"
|
|
1513
1608
|
}
|
|
1514
1609
|
) }) : null
|
|
1515
1610
|
] }) });
|
|
1516
1611
|
};
|
|
1517
1612
|
const config$5 = defineRouteConfig({
|
|
1518
|
-
label: "
|
|
1519
|
-
icon:
|
|
1613
|
+
label: "Return Orders",
|
|
1614
|
+
icon: ArrowPath
|
|
1520
1615
|
});
|
|
1521
1616
|
const useDebounce = (value, delay) => {
|
|
1522
1617
|
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
@@ -1534,27 +1629,19 @@ const getStatusBadgeClass$4 = (status) => {
|
|
|
1534
1629
|
if (s2 === "pending" || s2 === "requires_more") return "bg-ui-tag-orange-bg text-ui-tag-orange-text";
|
|
1535
1630
|
return "bg-ui-tag-purple-bg text-ui-tag-purple-text";
|
|
1536
1631
|
};
|
|
1537
|
-
const
|
|
1632
|
+
const PaymentsPage = () => {
|
|
1538
1633
|
const navigate = useNavigate();
|
|
1539
1634
|
const [items, setItems] = useState([]);
|
|
1635
|
+
const [statusFilter, setStatusFilter] = useState("all");
|
|
1540
1636
|
const [orderIdSearch, setOrderIdSearch] = useState("");
|
|
1541
1637
|
const debouncedOrderId = useDebounce(orderIdSearch, 300);
|
|
1542
|
-
const [paymentStatusFilter, setPaymentStatusFilter] = useState("all");
|
|
1543
|
-
const [providerSearch, setProviderSearch] = useState("");
|
|
1544
|
-
const debouncedProvider = useDebounce(providerSearch, 300);
|
|
1545
|
-
const [currencySearch, setCurrencySearch] = useState("");
|
|
1546
|
-
const debouncedCurrency = useDebounce(currencySearch, 300);
|
|
1547
|
-
const [dateFrom, setDateFrom] = useState("");
|
|
1548
|
-
const [dateTo, setDateTo] = useState("");
|
|
1549
|
-
const [amountMin, setAmountMin] = useState("");
|
|
1550
|
-
const [amountMax, setAmountMax] = useState("");
|
|
1551
1638
|
const [isLoading, setIsLoading] = useState(true);
|
|
1552
1639
|
const [isFetchingMore, setIsFetchingMore] = useState(false);
|
|
1553
1640
|
const [error, setError] = useState(null);
|
|
1554
1641
|
const [offset, setOffset] = useState(0);
|
|
1555
1642
|
const [count, setCount] = useState(0);
|
|
1556
1643
|
const limit = 50;
|
|
1557
|
-
const
|
|
1644
|
+
const loadTransactions = useCallback(
|
|
1558
1645
|
async (nextOffset, replace) => {
|
|
1559
1646
|
try {
|
|
1560
1647
|
if (replace) setIsLoading(true);
|
|
@@ -1563,25 +1650,18 @@ const RefundsPage = () => {
|
|
|
1563
1650
|
const params = new URLSearchParams();
|
|
1564
1651
|
params.set("limit", String(limit));
|
|
1565
1652
|
params.set("offset", String(nextOffset));
|
|
1653
|
+
if (statusFilter !== "all") params.set("status", statusFilter);
|
|
1566
1654
|
if (debouncedOrderId.trim()) params.set("order_id", debouncedOrderId.trim());
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
if (dateTo.trim()) params.set("date_to", dateTo.trim());
|
|
1572
|
-
const min = amountMin.trim() ? Number(amountMin) : void 0;
|
|
1573
|
-
const max = amountMax.trim() ? Number(amountMax) : void 0;
|
|
1574
|
-
if (min != null && !Number.isNaN(min)) params.set("amount_min", String(min));
|
|
1575
|
-
if (max != null && !Number.isNaN(max)) params.set("amount_max", String(max));
|
|
1576
|
-
const response = await fetch(`/admin/refunds?${params.toString()}`, {
|
|
1577
|
-
credentials: "include"
|
|
1578
|
-
});
|
|
1655
|
+
const response = await fetch(
|
|
1656
|
+
`/admin/payment-transactions?${params.toString()}`,
|
|
1657
|
+
{ credentials: "include" }
|
|
1658
|
+
);
|
|
1579
1659
|
if (!response.ok) {
|
|
1580
1660
|
const text = await response.text();
|
|
1581
|
-
throw new Error(text || "Failed to load
|
|
1661
|
+
throw new Error(text || "Failed to load payment transactions");
|
|
1582
1662
|
}
|
|
1583
1663
|
const payload = await response.json();
|
|
1584
|
-
const list = payload.
|
|
1664
|
+
const list = payload.transactions ?? [];
|
|
1585
1665
|
setCount(payload.count ?? 0);
|
|
1586
1666
|
setOffset(nextOffset + list.length);
|
|
1587
1667
|
setItems((prev) => replace ? list : [...prev, ...list]);
|
|
@@ -1592,75 +1672,46 @@ const RefundsPage = () => {
|
|
|
1592
1672
|
setIsFetchingMore(false);
|
|
1593
1673
|
}
|
|
1594
1674
|
},
|
|
1595
|
-
[
|
|
1596
|
-
debouncedOrderId,
|
|
1597
|
-
paymentStatusFilter,
|
|
1598
|
-
debouncedProvider,
|
|
1599
|
-
debouncedCurrency,
|
|
1600
|
-
dateFrom,
|
|
1601
|
-
dateTo,
|
|
1602
|
-
amountMin,
|
|
1603
|
-
amountMax
|
|
1604
|
-
]
|
|
1675
|
+
[statusFilter, debouncedOrderId]
|
|
1605
1676
|
);
|
|
1606
1677
|
useEffect(() => {
|
|
1607
|
-
void
|
|
1608
|
-
}, [
|
|
1678
|
+
void loadTransactions(0, true);
|
|
1679
|
+
}, [loadTransactions]);
|
|
1609
1680
|
const hasMore = useMemo(() => offset < count, [offset, count]);
|
|
1610
|
-
const
|
|
1611
|
-
const
|
|
1612
|
-
return `${code} ${Number(r.amount)}`;
|
|
1613
|
-
};
|
|
1614
|
-
const displayStatus = (r) => {
|
|
1615
|
-
const s2 = r.payment_status ?? "";
|
|
1681
|
+
const displayStatus = (t) => {
|
|
1682
|
+
const s2 = t.payment_id != null && t.payment_status != null && t.payment_status !== "" ? t.payment_status : t.session_status ?? "";
|
|
1616
1683
|
return s2 !== "" ? s2 : "—";
|
|
1617
1684
|
};
|
|
1685
|
+
const displayAmount = (t) => {
|
|
1686
|
+
const code = (t.currency_code ?? "USD").toUpperCase();
|
|
1687
|
+
return `${code} ${Number(t.amount)}`;
|
|
1688
|
+
};
|
|
1618
1689
|
return /* @__PURE__ */ jsx("div", { className: "w-full p-6", children: /* @__PURE__ */ jsxs(Container, { className: "mx-auto flex w-full max-w-7xl flex-col gap-6 p-6", children: [
|
|
1619
1690
|
/* @__PURE__ */ jsxs("header", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
1620
1691
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
1621
|
-
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "
|
|
1622
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "
|
|
1692
|
+
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "Payments" }),
|
|
1693
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "All payment attempts — completed, pending, failed, requires action" })
|
|
1623
1694
|
] }),
|
|
1624
|
-
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () =>
|
|
1695
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () => loadTransactions(0, true), children: "Refresh" })
|
|
1625
1696
|
] }),
|
|
1626
|
-
/* @__PURE__ */
|
|
1697
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
1627
1698
|
/* @__PURE__ */ jsx(
|
|
1628
1699
|
Input,
|
|
1629
1700
|
{
|
|
1630
|
-
placeholder: "Order ID",
|
|
1701
|
+
placeholder: "Search by Order ID",
|
|
1631
1702
|
value: orderIdSearch,
|
|
1632
1703
|
onChange: (e) => setOrderIdSearch(e.target.value),
|
|
1633
|
-
className: "md:max-w-
|
|
1634
|
-
"aria-label": "
|
|
1635
|
-
}
|
|
1636
|
-
),
|
|
1637
|
-
/* @__PURE__ */ jsx(
|
|
1638
|
-
Input,
|
|
1639
|
-
{
|
|
1640
|
-
placeholder: "Provider",
|
|
1641
|
-
value: providerSearch,
|
|
1642
|
-
onChange: (e) => setProviderSearch(e.target.value),
|
|
1643
|
-
className: "md:max-w-[140px]",
|
|
1644
|
-
"aria-label": "Filter by provider"
|
|
1645
|
-
}
|
|
1646
|
-
),
|
|
1647
|
-
/* @__PURE__ */ jsx(
|
|
1648
|
-
Input,
|
|
1649
|
-
{
|
|
1650
|
-
placeholder: "Currency",
|
|
1651
|
-
value: currencySearch,
|
|
1652
|
-
onChange: (e) => setCurrencySearch(e.target.value),
|
|
1653
|
-
className: "md:max-w-[100px]",
|
|
1654
|
-
"aria-label": "Filter by currency"
|
|
1704
|
+
className: "md:max-w-sm",
|
|
1705
|
+
"aria-label": "Search by order ID"
|
|
1655
1706
|
}
|
|
1656
1707
|
),
|
|
1657
|
-
/* @__PURE__ */ jsxs(
|
|
1708
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-3", children: /* @__PURE__ */ jsxs(
|
|
1658
1709
|
"select",
|
|
1659
1710
|
{
|
|
1660
|
-
value:
|
|
1661
|
-
onChange: (e) =>
|
|
1662
|
-
className: "h-9 rounded-md border border-ui-border-base bg-transparent px-3 text-sm text-ui-fg-base outline-none transition focus:ring-2 focus:ring-ui-fg-interactive md:max-w-
|
|
1663
|
-
"aria-label": "Filter by
|
|
1711
|
+
value: statusFilter,
|
|
1712
|
+
onChange: (e) => setStatusFilter(e.target.value),
|
|
1713
|
+
className: "h-9 rounded-md border border-ui-border-base bg-transparent px-3 text-sm text-ui-fg-base outline-none transition focus:ring-2 focus:ring-ui-fg-interactive md:max-w-xs",
|
|
1714
|
+
"aria-label": "Filter by status",
|
|
1664
1715
|
children: [
|
|
1665
1716
|
/* @__PURE__ */ jsx("option", { value: "all", children: "All statuses" }),
|
|
1666
1717
|
/* @__PURE__ */ jsx("option", { value: "pending", children: "Pending" }),
|
|
@@ -1671,103 +1722,52 @@ const RefundsPage = () => {
|
|
|
1671
1722
|
/* @__PURE__ */ jsx("option", { value: "captured", children: "Captured" })
|
|
1672
1723
|
]
|
|
1673
1724
|
}
|
|
1674
|
-
)
|
|
1675
|
-
|
|
1676
|
-
Input,
|
|
1677
|
-
{
|
|
1678
|
-
type: "date",
|
|
1679
|
-
placeholder: "From",
|
|
1680
|
-
value: dateFrom,
|
|
1681
|
-
onChange: (e) => setDateFrom(e.target.value),
|
|
1682
|
-
className: "md:max-w-[140px]",
|
|
1683
|
-
"aria-label": "Date from"
|
|
1684
|
-
}
|
|
1685
|
-
),
|
|
1686
|
-
/* @__PURE__ */ jsx(
|
|
1687
|
-
Input,
|
|
1688
|
-
{
|
|
1689
|
-
type: "date",
|
|
1690
|
-
placeholder: "To",
|
|
1691
|
-
value: dateTo,
|
|
1692
|
-
onChange: (e) => setDateTo(e.target.value),
|
|
1693
|
-
className: "md:max-w-[140px]",
|
|
1694
|
-
"aria-label": "Date to"
|
|
1695
|
-
}
|
|
1696
|
-
),
|
|
1697
|
-
/* @__PURE__ */ jsx(
|
|
1698
|
-
Input,
|
|
1699
|
-
{
|
|
1700
|
-
placeholder: "Amount min",
|
|
1701
|
-
value: amountMin,
|
|
1702
|
-
onChange: (e) => setAmountMin(e.target.value),
|
|
1703
|
-
type: "number",
|
|
1704
|
-
min: 0,
|
|
1705
|
-
className: "md:max-w-[100px]",
|
|
1706
|
-
"aria-label": "Refund amount minimum"
|
|
1707
|
-
}
|
|
1708
|
-
),
|
|
1709
|
-
/* @__PURE__ */ jsx(
|
|
1710
|
-
Input,
|
|
1711
|
-
{
|
|
1712
|
-
placeholder: "Amount max",
|
|
1713
|
-
value: amountMax,
|
|
1714
|
-
onChange: (e) => setAmountMax(e.target.value),
|
|
1715
|
-
type: "number",
|
|
1716
|
-
min: 0,
|
|
1717
|
-
className: "md:max-w-[100px]",
|
|
1718
|
-
"aria-label": "Refund amount maximum"
|
|
1719
|
-
}
|
|
1720
|
-
)
|
|
1721
|
-
] }) }),
|
|
1725
|
+
) })
|
|
1726
|
+
] }),
|
|
1722
1727
|
error ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-strong p-6 text-center", children: [
|
|
1723
1728
|
/* @__PURE__ */ jsx(Text, { weight: "plus", className: "text-ui-fg-error", children: error }),
|
|
1724
|
-
/* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: () =>
|
|
1729
|
+
/* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: () => loadTransactions(0, true), children: "Try again" }) })
|
|
1725
1730
|
] }) : null,
|
|
1726
|
-
isLoading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading
|
|
1727
|
-
/* @__PURE__ */ jsx(Heading, { level: "h3", className: "text-xl", children: "No
|
|
1728
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "mt-2 text-ui-fg-subtle", children: "
|
|
1729
|
-
] }) : /* @__PURE__ */ jsx("div", { className: "
|
|
1731
|
+
isLoading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading payments…" }) }) : items.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-dashed border-ui-border-strong p-10 text-center", children: [
|
|
1732
|
+
/* @__PURE__ */ jsx(Heading, { level: "h3", className: "text-xl", children: "No payment transactions yet" }),
|
|
1733
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "mt-2 text-ui-fg-subtle", children: "Payment attempts will appear here." })
|
|
1734
|
+
] }) : /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-xl border border-ui-border-base", children: /* @__PURE__ */ jsxs("table", { className: "min-w-full divide-y divide-ui-border-base", children: [
|
|
1730
1735
|
/* @__PURE__ */ jsx("thead", { className: "bg-ui-bg-subtle", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
1731
|
-
/* @__PURE__ */ jsx("th", { className: "
|
|
1732
|
-
/* @__PURE__ */ jsx("th", { className: "
|
|
1733
|
-
/* @__PURE__ */ jsx("th", { className: "
|
|
1734
|
-
/* @__PURE__ */ jsx("th", { className: "
|
|
1735
|
-
/* @__PURE__ */ jsx("th", { className: "
|
|
1736
|
-
/* @__PURE__ */ jsx("th", { className: "
|
|
1737
|
-
/* @__PURE__ */ jsx("th", { className: "
|
|
1738
|
-
/* @__PURE__ */ jsx("th", { className: "w-[14%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Note" }),
|
|
1739
|
-
/* @__PURE__ */ jsx("th", { className: "w-[11%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Created" }),
|
|
1740
|
-
/* @__PURE__ */ jsx("th", { className: "w-[8%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Actions" })
|
|
1736
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Order ID" }),
|
|
1737
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Amount" }),
|
|
1738
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Provider" }),
|
|
1739
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Status" }),
|
|
1740
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Finalized" }),
|
|
1741
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Created" }),
|
|
1742
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Actions" })
|
|
1741
1743
|
] }) }),
|
|
1742
|
-
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-ui-border-subtle", children: items.map((
|
|
1744
|
+
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-ui-border-subtle", children: items.map((t) => /* @__PURE__ */ jsxs(
|
|
1743
1745
|
"tr",
|
|
1744
1746
|
{
|
|
1745
|
-
className: "
|
|
1746
|
-
onClick: () => navigate(`/
|
|
1747
|
+
className: "hover:bg-ui-bg-subtle/60 cursor-pointer",
|
|
1748
|
+
onClick: () => navigate(`/payments/${t.payment_session_id}`),
|
|
1747
1749
|
children: [
|
|
1748
|
-
/* @__PURE__ */ jsx("td", { className: "
|
|
1749
|
-
/* @__PURE__ */ jsx("td", { className: "
|
|
1750
|
-
/* @__PURE__ */ jsx("td", { className: "
|
|
1751
|
-
/* @__PURE__ */ jsx("td", { className: "
|
|
1752
|
-
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 text-ui-fg-subtle uppercase", children: r.currency_code || "—" }),
|
|
1753
|
-
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 text-ui-fg-subtle", title: r.provider_id || void 0, children: r.provider_id || "—" }),
|
|
1754
|
-
/* @__PURE__ */ jsx("td", { className: "min-w-0 px-3 py-3", children: /* @__PURE__ */ jsx(
|
|
1750
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 font-medium text-ui-fg-base", children: t.order_id ?? "—" }),
|
|
1751
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: displayAmount(t) }),
|
|
1752
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: t.provider_id }),
|
|
1753
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4", children: /* @__PURE__ */ jsx(
|
|
1755
1754
|
Badge,
|
|
1756
1755
|
{
|
|
1757
1756
|
size: "2xsmall",
|
|
1758
|
-
className: `uppercase ${getStatusBadgeClass$4(displayStatus(
|
|
1759
|
-
children: displayStatus(
|
|
1757
|
+
className: `uppercase ${getStatusBadgeClass$4(displayStatus(t))}`,
|
|
1758
|
+
children: displayStatus(t) !== "—" ? displayStatus(t).replace(/_/g, " ") : "—"
|
|
1760
1759
|
}
|
|
1761
1760
|
) }),
|
|
1762
|
-
/* @__PURE__ */ jsx("td", { className: "
|
|
1763
|
-
/* @__PURE__ */ jsx("td", { className: "
|
|
1761
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: t.payment_id != null ? "Yes" : "No" }),
|
|
1762
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: new Date(t.created_at).toLocaleDateString("en-US", {
|
|
1763
|
+
year: "numeric",
|
|
1764
1764
|
month: "short",
|
|
1765
1765
|
day: "numeric",
|
|
1766
1766
|
hour: "numeric",
|
|
1767
1767
|
minute: "2-digit",
|
|
1768
1768
|
hour12: true
|
|
1769
1769
|
}) }),
|
|
1770
|
-
/* @__PURE__ */
|
|
1770
|
+
/* @__PURE__ */ jsxs("td", { className: "px-4 py-4", children: [
|
|
1771
1771
|
/* @__PURE__ */ jsx(
|
|
1772
1772
|
Button,
|
|
1773
1773
|
{
|
|
@@ -1775,27 +1775,27 @@ const RefundsPage = () => {
|
|
|
1775
1775
|
size: "small",
|
|
1776
1776
|
onClick: (e) => {
|
|
1777
1777
|
e.stopPropagation();
|
|
1778
|
-
navigate(`/
|
|
1778
|
+
navigate(`/payments/${t.payment_session_id}`);
|
|
1779
1779
|
},
|
|
1780
|
-
children: "
|
|
1780
|
+
children: "View details"
|
|
1781
1781
|
}
|
|
1782
1782
|
),
|
|
1783
|
-
|
|
1783
|
+
t.order_id ? /* @__PURE__ */ jsx(
|
|
1784
1784
|
Button,
|
|
1785
1785
|
{
|
|
1786
1786
|
variant: "transparent",
|
|
1787
1787
|
size: "small",
|
|
1788
1788
|
onClick: (e) => {
|
|
1789
1789
|
e.stopPropagation();
|
|
1790
|
-
navigate(`/orders/${
|
|
1790
|
+
navigate(`/orders/${t.order_id}`);
|
|
1791
1791
|
},
|
|
1792
1792
|
children: "Order"
|
|
1793
1793
|
}
|
|
1794
1794
|
) : null
|
|
1795
|
-
] })
|
|
1795
|
+
] })
|
|
1796
1796
|
]
|
|
1797
1797
|
},
|
|
1798
|
-
|
|
1798
|
+
t.payment_session_id
|
|
1799
1799
|
)) })
|
|
1800
1800
|
] }) }),
|
|
1801
1801
|
hasMore ? /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx(
|
|
@@ -1803,15 +1803,15 @@ const RefundsPage = () => {
|
|
|
1803
1803
|
{
|
|
1804
1804
|
variant: "secondary",
|
|
1805
1805
|
isLoading: isFetchingMore,
|
|
1806
|
-
onClick: () =>
|
|
1806
|
+
onClick: () => loadTransactions(offset, false),
|
|
1807
1807
|
children: "Load more"
|
|
1808
1808
|
}
|
|
1809
1809
|
) }) : null
|
|
1810
1810
|
] }) });
|
|
1811
1811
|
};
|
|
1812
1812
|
const config$4 = defineRouteConfig({
|
|
1813
|
-
label: "
|
|
1814
|
-
icon:
|
|
1813
|
+
label: "Payments",
|
|
1814
|
+
icon: CreditCard
|
|
1815
1815
|
});
|
|
1816
1816
|
const getStatusBadgeClass$3 = (status) => {
|
|
1817
1817
|
const statusLower = status.toLowerCase();
|
|
@@ -2088,11 +2088,203 @@ const SwapDetailPage = () => {
|
|
|
2088
2088
|
] })
|
|
2089
2089
|
] }) });
|
|
2090
2090
|
};
|
|
2091
|
-
const config$3 = defineRouteConfig({
|
|
2092
|
-
label: "Swap Details",
|
|
2093
|
-
icon: ArrowPath
|
|
2091
|
+
const config$3 = defineRouteConfig({
|
|
2092
|
+
label: "Swap Details",
|
|
2093
|
+
icon: ArrowPath
|
|
2094
|
+
});
|
|
2095
|
+
const getStatusBadgeClass$2 = (status) => {
|
|
2096
|
+
const s2 = status.toLowerCase();
|
|
2097
|
+
if (s2 === "captured" || s2 === "completed") return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
2098
|
+
if (s2 === "authorized") return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
2099
|
+
if (s2 === "error" || s2 === "canceled" || s2 === "cancelled") return "bg-ui-tag-red-bg text-ui-tag-red-text";
|
|
2100
|
+
if (s2 === "pending" || s2 === "requires_more") return "bg-ui-tag-orange-bg text-ui-tag-orange-text";
|
|
2101
|
+
return "bg-ui-tag-purple-bg text-ui-tag-purple-text";
|
|
2102
|
+
};
|
|
2103
|
+
const formatAmount = (value) => {
|
|
2104
|
+
return String(value);
|
|
2105
|
+
};
|
|
2106
|
+
const RefundDetailPage = () => {
|
|
2107
|
+
var _a, _b, _c;
|
|
2108
|
+
const navigate = useNavigate();
|
|
2109
|
+
const params = useParams();
|
|
2110
|
+
const id = (_a = params == null ? void 0 : params.id) == null ? void 0 : _a.trim();
|
|
2111
|
+
const [detail, setDetail] = useState(null);
|
|
2112
|
+
const [loading, setLoading] = useState(!!id);
|
|
2113
|
+
const [error, setError] = useState(null);
|
|
2114
|
+
const [gatewayExpanded, setGatewayExpanded] = useState(false);
|
|
2115
|
+
useEffect(() => {
|
|
2116
|
+
if (!id) {
|
|
2117
|
+
setLoading(false);
|
|
2118
|
+
return;
|
|
2119
|
+
}
|
|
2120
|
+
let cancelled = false;
|
|
2121
|
+
setLoading(true);
|
|
2122
|
+
setError(null);
|
|
2123
|
+
fetch(`/admin/refunds/${id}`, { credentials: "include" }).then((res) => {
|
|
2124
|
+
if (!res.ok) throw new Error(res.statusText || "Failed to load");
|
|
2125
|
+
return res.json();
|
|
2126
|
+
}).then((data) => {
|
|
2127
|
+
if (!cancelled) setDetail(data);
|
|
2128
|
+
}).catch((e) => {
|
|
2129
|
+
if (!cancelled) setError(e instanceof Error ? e.message : "Failed to load");
|
|
2130
|
+
}).finally(() => {
|
|
2131
|
+
if (!cancelled) setLoading(false);
|
|
2132
|
+
});
|
|
2133
|
+
return () => {
|
|
2134
|
+
cancelled = true;
|
|
2135
|
+
};
|
|
2136
|
+
}, [id]);
|
|
2137
|
+
const paymentStatus = ((_b = detail == null ? void 0 : detail.payment) == null ? void 0 : _b.status) ?? "—";
|
|
2138
|
+
const hasGatewayData = ((_c = detail == null ? void 0 : detail.payment) == null ? void 0 : _c.payment_data) && typeof detail.payment.payment_data === "object" && Object.keys(detail.payment.payment_data).length > 0;
|
|
2139
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full p-6", children: /* @__PURE__ */ jsxs(Container, { className: "mx-auto flex w-full max-w-4xl flex-col gap-6 p-6", children: [
|
|
2140
|
+
/* @__PURE__ */ jsx("header", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
2141
|
+
/* @__PURE__ */ jsx(Button, { variant: "transparent", size: "small", onClick: () => navigate("/refunds"), children: "← Refunds" }),
|
|
2142
|
+
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "Refund details" }),
|
|
2143
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle font-mono", children: id ?? "—" })
|
|
2144
|
+
] }) }),
|
|
2145
|
+
error ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-strong p-6 text-center", children: [
|
|
2146
|
+
/* @__PURE__ */ jsx(Text, { weight: "plus", className: "text-ui-fg-error", children: error }),
|
|
2147
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", className: "mt-4", onClick: () => navigate("/refunds"), children: "Back to list" })
|
|
2148
|
+
] }) : loading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading…" }) }) : detail ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
|
|
2149
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2150
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg mb-4", children: "Refund summary" }),
|
|
2151
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
2152
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2153
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Refund ID" }),
|
|
2154
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block font-mono text-sm", children: detail.refund.id })
|
|
2155
|
+
] }),
|
|
2156
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2157
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Amount" }),
|
|
2158
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.refund.amount) })
|
|
2159
|
+
] }),
|
|
2160
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2161
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Note" }),
|
|
2162
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.refund.note ?? "—" })
|
|
2163
|
+
] }),
|
|
2164
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2165
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Created at" }),
|
|
2166
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: new Date(detail.refund.created_at).toLocaleDateString("en-US", {
|
|
2167
|
+
year: "numeric",
|
|
2168
|
+
month: "short",
|
|
2169
|
+
day: "numeric",
|
|
2170
|
+
hour: "numeric",
|
|
2171
|
+
minute: "2-digit",
|
|
2172
|
+
hour12: true
|
|
2173
|
+
}) })
|
|
2174
|
+
] }),
|
|
2175
|
+
detail.refund.created_by ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2176
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Created by" }),
|
|
2177
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block font-mono text-sm", children: detail.refund.created_by })
|
|
2178
|
+
] }) : null
|
|
2179
|
+
] })
|
|
2180
|
+
] }),
|
|
2181
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2182
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg mb-4", children: "Payment summary" }),
|
|
2183
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
2184
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2185
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Payment amount" }),
|
|
2186
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.payment.payment_amount) })
|
|
2187
|
+
] }),
|
|
2188
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2189
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Captured amount" }),
|
|
2190
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.payment.captured_amount) })
|
|
2191
|
+
] }),
|
|
2192
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2193
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Refunded amount" }),
|
|
2194
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.payment.refunded_amount) })
|
|
2195
|
+
] }),
|
|
2196
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2197
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Provider" }),
|
|
2198
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.payment.provider_id || "—" })
|
|
2199
|
+
] }),
|
|
2200
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2201
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Status" }),
|
|
2202
|
+
/* @__PURE__ */ jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsx(
|
|
2203
|
+
Badge,
|
|
2204
|
+
{
|
|
2205
|
+
size: "2xsmall",
|
|
2206
|
+
className: `uppercase ${getStatusBadgeClass$2(paymentStatus)}`,
|
|
2207
|
+
children: paymentStatus !== "—" ? paymentStatus.replace(/_/g, " ") : "—"
|
|
2208
|
+
}
|
|
2209
|
+
) })
|
|
2210
|
+
] }),
|
|
2211
|
+
detail.computed ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2212
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2213
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Full refund" }),
|
|
2214
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.computed.is_full_refund ? "Yes" : "No" })
|
|
2215
|
+
] }),
|
|
2216
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2217
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Remaining refundable" }),
|
|
2218
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.computed.remaining_refundable_amount) })
|
|
2219
|
+
] }),
|
|
2220
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2221
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Refund %" }),
|
|
2222
|
+
/* @__PURE__ */ jsxs(Text, { className: "mt-1 block", children: [
|
|
2223
|
+
detail.computed.refund_percentage.toFixed(1),
|
|
2224
|
+
"%"
|
|
2225
|
+
] })
|
|
2226
|
+
] })
|
|
2227
|
+
] }) : null
|
|
2228
|
+
] })
|
|
2229
|
+
] }),
|
|
2230
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2231
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg mb-4", children: "Order summary" }),
|
|
2232
|
+
detail.order ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
2233
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2234
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Order" }),
|
|
2235
|
+
/* @__PURE__ */ jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsx(
|
|
2236
|
+
Button,
|
|
2237
|
+
{
|
|
2238
|
+
variant: "transparent",
|
|
2239
|
+
size: "small",
|
|
2240
|
+
onClick: () => navigate(`/orders/${detail.order.order_id}`),
|
|
2241
|
+
children: detail.order.order_number ?? detail.order.order_id
|
|
2242
|
+
}
|
|
2243
|
+
) })
|
|
2244
|
+
] }),
|
|
2245
|
+
detail.order.total != null ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2246
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Total" }),
|
|
2247
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.order.total) })
|
|
2248
|
+
] }) : null,
|
|
2249
|
+
detail.order.customer_id ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2250
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Customer ID" }),
|
|
2251
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block font-mono text-sm", children: detail.order.customer_id })
|
|
2252
|
+
] }) : null,
|
|
2253
|
+
detail.order.region ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2254
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Region" }),
|
|
2255
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.order.region })
|
|
2256
|
+
] }) : null,
|
|
2257
|
+
detail.order.fulfillment_status ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2258
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Fulfillment status" }),
|
|
2259
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.order.fulfillment_status })
|
|
2260
|
+
] }) : null
|
|
2261
|
+
] }) : /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "No order linked to this refund." })
|
|
2262
|
+
] }),
|
|
2263
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2264
|
+
/* @__PURE__ */ jsxs(
|
|
2265
|
+
"button",
|
|
2266
|
+
{
|
|
2267
|
+
type: "button",
|
|
2268
|
+
className: "flex w-full items-center justify-between text-left",
|
|
2269
|
+
onClick: () => setGatewayExpanded((prev) => !prev),
|
|
2270
|
+
"aria-expanded": gatewayExpanded,
|
|
2271
|
+
"aria-label": gatewayExpanded ? "Collapse gateway data" : "Expand gateway data",
|
|
2272
|
+
children: [
|
|
2273
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg", children: "Gateway data" }),
|
|
2274
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: gatewayExpanded ? "Collapse" : "Expand" })
|
|
2275
|
+
]
|
|
2276
|
+
}
|
|
2277
|
+
),
|
|
2278
|
+
gatewayExpanded && /* @__PURE__ */ jsx("div", { className: "mt-4", children: hasGatewayData ? /* @__PURE__ */ jsx("pre", { className: "text-xs bg-ui-bg-subtle p-4 rounded-lg overflow-auto max-h-96", children: JSON.stringify(detail.payment.payment_data, null, 2) }) : /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "No gateway payload for this payment." }) })
|
|
2279
|
+
] })
|
|
2280
|
+
] }) : null
|
|
2281
|
+
] }) });
|
|
2282
|
+
};
|
|
2283
|
+
const config$2 = defineRouteConfig({
|
|
2284
|
+
label: "Refund details",
|
|
2285
|
+
icon: Receipt
|
|
2094
2286
|
});
|
|
2095
|
-
const getStatusBadgeClass$
|
|
2287
|
+
const getStatusBadgeClass$1 = (status) => {
|
|
2096
2288
|
const statusLower = status.toLowerCase();
|
|
2097
2289
|
if (statusLower === "requested") {
|
|
2098
2290
|
return "bg-ui-tag-orange-bg text-ui-tag-orange-text";
|
|
@@ -2226,7 +2418,7 @@ const ReturnDetailPage = () => {
|
|
|
2226
2418
|
Badge,
|
|
2227
2419
|
{
|
|
2228
2420
|
size: "small",
|
|
2229
|
-
className: `uppercase ${getStatusBadgeClass$
|
|
2421
|
+
className: `uppercase ${getStatusBadgeClass$1(returnOrder.status)}`,
|
|
2230
2422
|
children: returnOrder.status.replace(/_/g, " ")
|
|
2231
2423
|
}
|
|
2232
2424
|
)
|
|
@@ -2308,7 +2500,7 @@ const ReturnDetailPage = () => {
|
|
|
2308
2500
|
Badge,
|
|
2309
2501
|
{
|
|
2310
2502
|
size: "2xsmall",
|
|
2311
|
-
className: `uppercase ${getStatusBadgeClass$
|
|
2503
|
+
className: `uppercase ${getStatusBadgeClass$1(entry.status)}`,
|
|
2312
2504
|
children: entry.status.replace(/_/g, " ")
|
|
2313
2505
|
}
|
|
2314
2506
|
) }),
|
|
@@ -2366,11 +2558,11 @@ const ReturnDetailPage = () => {
|
|
|
2366
2558
|
updateSuccess && /* @__PURE__ */ jsx("div", { className: "rounded-lg border border-ui-border-success bg-ui-bg-success-subtle p-4", children: /* @__PURE__ */ jsx(Text, { className: "text-ui-fg-success", children: "Action completed successfully" }) })
|
|
2367
2559
|
] }) });
|
|
2368
2560
|
};
|
|
2369
|
-
const config$
|
|
2561
|
+
const config$1 = defineRouteConfig({
|
|
2370
2562
|
label: "Return Order Details",
|
|
2371
2563
|
icon: CheckCircle
|
|
2372
2564
|
});
|
|
2373
|
-
const getStatusBadgeClass
|
|
2565
|
+
const getStatusBadgeClass = (status) => {
|
|
2374
2566
|
const s2 = status.toLowerCase();
|
|
2375
2567
|
if (s2 === "captured" || s2 === "completed") return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
2376
2568
|
if (s2 === "authorized") return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
@@ -2449,7 +2641,7 @@ const PaymentDetailPage = () => {
|
|
|
2449
2641
|
Badge,
|
|
2450
2642
|
{
|
|
2451
2643
|
size: "2xsmall",
|
|
2452
|
-
className: `uppercase ${getStatusBadgeClass
|
|
2644
|
+
className: `uppercase ${getStatusBadgeClass(displayStatus)}`,
|
|
2453
2645
|
children: displayStatus !== "—" ? displayStatus.replace(/_/g, " ") : "—"
|
|
2454
2646
|
}
|
|
2455
2647
|
) })
|
|
@@ -2485,202 +2677,10 @@ const PaymentDetailPage = () => {
|
|
|
2485
2677
|
] }) : null
|
|
2486
2678
|
] }) });
|
|
2487
2679
|
};
|
|
2488
|
-
const config
|
|
2680
|
+
const config = defineRouteConfig({
|
|
2489
2681
|
label: "Payment details",
|
|
2490
2682
|
icon: CreditCard
|
|
2491
2683
|
});
|
|
2492
|
-
const getStatusBadgeClass = (status) => {
|
|
2493
|
-
const s2 = status.toLowerCase();
|
|
2494
|
-
if (s2 === "captured" || s2 === "completed") return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
2495
|
-
if (s2 === "authorized") return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
2496
|
-
if (s2 === "error" || s2 === "canceled" || s2 === "cancelled") return "bg-ui-tag-red-bg text-ui-tag-red-text";
|
|
2497
|
-
if (s2 === "pending" || s2 === "requires_more") return "bg-ui-tag-orange-bg text-ui-tag-orange-text";
|
|
2498
|
-
return "bg-ui-tag-purple-bg text-ui-tag-purple-text";
|
|
2499
|
-
};
|
|
2500
|
-
const formatAmount = (value) => {
|
|
2501
|
-
return String(value);
|
|
2502
|
-
};
|
|
2503
|
-
const RefundDetailPage = () => {
|
|
2504
|
-
var _a, _b, _c;
|
|
2505
|
-
const navigate = useNavigate();
|
|
2506
|
-
const params = useParams();
|
|
2507
|
-
const id = (_a = params == null ? void 0 : params.id) == null ? void 0 : _a.trim();
|
|
2508
|
-
const [detail, setDetail] = useState(null);
|
|
2509
|
-
const [loading, setLoading] = useState(!!id);
|
|
2510
|
-
const [error, setError] = useState(null);
|
|
2511
|
-
const [gatewayExpanded, setGatewayExpanded] = useState(false);
|
|
2512
|
-
useEffect(() => {
|
|
2513
|
-
if (!id) {
|
|
2514
|
-
setLoading(false);
|
|
2515
|
-
return;
|
|
2516
|
-
}
|
|
2517
|
-
let cancelled = false;
|
|
2518
|
-
setLoading(true);
|
|
2519
|
-
setError(null);
|
|
2520
|
-
fetch(`/admin/refunds/${id}`, { credentials: "include" }).then((res) => {
|
|
2521
|
-
if (!res.ok) throw new Error(res.statusText || "Failed to load");
|
|
2522
|
-
return res.json();
|
|
2523
|
-
}).then((data) => {
|
|
2524
|
-
if (!cancelled) setDetail(data);
|
|
2525
|
-
}).catch((e) => {
|
|
2526
|
-
if (!cancelled) setError(e instanceof Error ? e.message : "Failed to load");
|
|
2527
|
-
}).finally(() => {
|
|
2528
|
-
if (!cancelled) setLoading(false);
|
|
2529
|
-
});
|
|
2530
|
-
return () => {
|
|
2531
|
-
cancelled = true;
|
|
2532
|
-
};
|
|
2533
|
-
}, [id]);
|
|
2534
|
-
const paymentStatus = ((_b = detail == null ? void 0 : detail.payment) == null ? void 0 : _b.status) ?? "—";
|
|
2535
|
-
const hasGatewayData = ((_c = detail == null ? void 0 : detail.payment) == null ? void 0 : _c.payment_data) && typeof detail.payment.payment_data === "object" && Object.keys(detail.payment.payment_data).length > 0;
|
|
2536
|
-
return /* @__PURE__ */ jsx("div", { className: "w-full p-6", children: /* @__PURE__ */ jsxs(Container, { className: "mx-auto flex w-full max-w-4xl flex-col gap-6 p-6", children: [
|
|
2537
|
-
/* @__PURE__ */ jsx("header", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
2538
|
-
/* @__PURE__ */ jsx(Button, { variant: "transparent", size: "small", onClick: () => navigate("/refunds"), children: "← Refunds" }),
|
|
2539
|
-
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "Refund details" }),
|
|
2540
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle font-mono", children: id ?? "—" })
|
|
2541
|
-
] }) }),
|
|
2542
|
-
error ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-strong p-6 text-center", children: [
|
|
2543
|
-
/* @__PURE__ */ jsx(Text, { weight: "plus", className: "text-ui-fg-error", children: error }),
|
|
2544
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", className: "mt-4", onClick: () => navigate("/refunds"), children: "Back to list" })
|
|
2545
|
-
] }) : loading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading…" }) }) : detail ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
|
|
2546
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2547
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg mb-4", children: "Refund summary" }),
|
|
2548
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
2549
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2550
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Refund ID" }),
|
|
2551
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block font-mono text-sm", children: detail.refund.id })
|
|
2552
|
-
] }),
|
|
2553
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2554
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Amount" }),
|
|
2555
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.refund.amount) })
|
|
2556
|
-
] }),
|
|
2557
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2558
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Note" }),
|
|
2559
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.refund.note ?? "—" })
|
|
2560
|
-
] }),
|
|
2561
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2562
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Created at" }),
|
|
2563
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: new Date(detail.refund.created_at).toLocaleDateString("en-US", {
|
|
2564
|
-
year: "numeric",
|
|
2565
|
-
month: "short",
|
|
2566
|
-
day: "numeric",
|
|
2567
|
-
hour: "numeric",
|
|
2568
|
-
minute: "2-digit",
|
|
2569
|
-
hour12: true
|
|
2570
|
-
}) })
|
|
2571
|
-
] }),
|
|
2572
|
-
detail.refund.created_by ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2573
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Created by" }),
|
|
2574
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block font-mono text-sm", children: detail.refund.created_by })
|
|
2575
|
-
] }) : null
|
|
2576
|
-
] })
|
|
2577
|
-
] }),
|
|
2578
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2579
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg mb-4", children: "Payment summary" }),
|
|
2580
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
2581
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2582
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Payment amount" }),
|
|
2583
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.payment.payment_amount) })
|
|
2584
|
-
] }),
|
|
2585
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2586
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Captured amount" }),
|
|
2587
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.payment.captured_amount) })
|
|
2588
|
-
] }),
|
|
2589
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2590
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Refunded amount" }),
|
|
2591
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.payment.refunded_amount) })
|
|
2592
|
-
] }),
|
|
2593
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2594
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Provider" }),
|
|
2595
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.payment.provider_id || "—" })
|
|
2596
|
-
] }),
|
|
2597
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2598
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Status" }),
|
|
2599
|
-
/* @__PURE__ */ jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsx(
|
|
2600
|
-
Badge,
|
|
2601
|
-
{
|
|
2602
|
-
size: "2xsmall",
|
|
2603
|
-
className: `uppercase ${getStatusBadgeClass(paymentStatus)}`,
|
|
2604
|
-
children: paymentStatus !== "—" ? paymentStatus.replace(/_/g, " ") : "—"
|
|
2605
|
-
}
|
|
2606
|
-
) })
|
|
2607
|
-
] }),
|
|
2608
|
-
detail.computed ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2609
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2610
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Full refund" }),
|
|
2611
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.computed.is_full_refund ? "Yes" : "No" })
|
|
2612
|
-
] }),
|
|
2613
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2614
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Remaining refundable" }),
|
|
2615
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.computed.remaining_refundable_amount) })
|
|
2616
|
-
] }),
|
|
2617
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2618
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Refund %" }),
|
|
2619
|
-
/* @__PURE__ */ jsxs(Text, { className: "mt-1 block", children: [
|
|
2620
|
-
detail.computed.refund_percentage.toFixed(1),
|
|
2621
|
-
"%"
|
|
2622
|
-
] })
|
|
2623
|
-
] })
|
|
2624
|
-
] }) : null
|
|
2625
|
-
] })
|
|
2626
|
-
] }),
|
|
2627
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2628
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg mb-4", children: "Order summary" }),
|
|
2629
|
-
detail.order ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
2630
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2631
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Order" }),
|
|
2632
|
-
/* @__PURE__ */ jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsx(
|
|
2633
|
-
Button,
|
|
2634
|
-
{
|
|
2635
|
-
variant: "transparent",
|
|
2636
|
-
size: "small",
|
|
2637
|
-
onClick: () => navigate(`/orders/${detail.order.order_id}`),
|
|
2638
|
-
children: detail.order.order_number ?? detail.order.order_id
|
|
2639
|
-
}
|
|
2640
|
-
) })
|
|
2641
|
-
] }),
|
|
2642
|
-
detail.order.total != null ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2643
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Total" }),
|
|
2644
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.order.total) })
|
|
2645
|
-
] }) : null,
|
|
2646
|
-
detail.order.customer_id ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2647
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Customer ID" }),
|
|
2648
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block font-mono text-sm", children: detail.order.customer_id })
|
|
2649
|
-
] }) : null,
|
|
2650
|
-
detail.order.region ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2651
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Region" }),
|
|
2652
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.order.region })
|
|
2653
|
-
] }) : null,
|
|
2654
|
-
detail.order.fulfillment_status ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2655
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Fulfillment status" }),
|
|
2656
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.order.fulfillment_status })
|
|
2657
|
-
] }) : null
|
|
2658
|
-
] }) : /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "No order linked to this refund." })
|
|
2659
|
-
] }),
|
|
2660
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2661
|
-
/* @__PURE__ */ jsxs(
|
|
2662
|
-
"button",
|
|
2663
|
-
{
|
|
2664
|
-
type: "button",
|
|
2665
|
-
className: "flex w-full items-center justify-between text-left",
|
|
2666
|
-
onClick: () => setGatewayExpanded((prev) => !prev),
|
|
2667
|
-
"aria-expanded": gatewayExpanded,
|
|
2668
|
-
"aria-label": gatewayExpanded ? "Collapse gateway data" : "Expand gateway data",
|
|
2669
|
-
children: [
|
|
2670
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg", children: "Gateway data" }),
|
|
2671
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: gatewayExpanded ? "Collapse" : "Expand" })
|
|
2672
|
-
]
|
|
2673
|
-
}
|
|
2674
|
-
),
|
|
2675
|
-
gatewayExpanded && /* @__PURE__ */ jsx("div", { className: "mt-4", children: hasGatewayData ? /* @__PURE__ */ jsx("pre", { className: "text-xs bg-ui-bg-subtle p-4 rounded-lg overflow-auto max-h-96", children: JSON.stringify(detail.payment.payment_data, null, 2) }) : /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "No gateway payload for this payment." }) })
|
|
2676
|
-
] })
|
|
2677
|
-
] }) : null
|
|
2678
|
-
] }) });
|
|
2679
|
-
};
|
|
2680
|
-
const config = defineRouteConfig({
|
|
2681
|
-
label: "Refund details",
|
|
2682
|
-
icon: Receipt
|
|
2683
|
-
});
|
|
2684
2684
|
const i18nTranslations0 = {};
|
|
2685
2685
|
const widgetModule = { widgets: [
|
|
2686
2686
|
{
|
|
@@ -2698,6 +2698,10 @@ const routeModule = {
|
|
|
2698
2698
|
Component: SwapsPage,
|
|
2699
2699
|
path: "/swaps"
|
|
2700
2700
|
},
|
|
2701
|
+
{
|
|
2702
|
+
Component: RefundsPage,
|
|
2703
|
+
path: "/refunds"
|
|
2704
|
+
},
|
|
2701
2705
|
{
|
|
2702
2706
|
Component: ReturnsPage,
|
|
2703
2707
|
path: "/returns"
|
|
@@ -2706,14 +2710,14 @@ const routeModule = {
|
|
|
2706
2710
|
Component: PaymentsPage,
|
|
2707
2711
|
path: "/payments"
|
|
2708
2712
|
},
|
|
2709
|
-
{
|
|
2710
|
-
Component: RefundsPage,
|
|
2711
|
-
path: "/refunds"
|
|
2712
|
-
},
|
|
2713
2713
|
{
|
|
2714
2714
|
Component: SwapDetailPage,
|
|
2715
2715
|
path: "/swaps/:id"
|
|
2716
2716
|
},
|
|
2717
|
+
{
|
|
2718
|
+
Component: RefundDetailPage,
|
|
2719
|
+
path: "/refunds/:id"
|
|
2720
|
+
},
|
|
2717
2721
|
{
|
|
2718
2722
|
Component: ReturnDetailPage,
|
|
2719
2723
|
path: "/returns/:id"
|
|
@@ -2721,24 +2725,26 @@ const routeModule = {
|
|
|
2721
2725
|
{
|
|
2722
2726
|
Component: PaymentDetailPage,
|
|
2723
2727
|
path: "/payments/:id"
|
|
2724
|
-
},
|
|
2725
|
-
{
|
|
2726
|
-
Component: RefundDetailPage,
|
|
2727
|
-
path: "/refunds/:id"
|
|
2728
2728
|
}
|
|
2729
2729
|
]
|
|
2730
2730
|
};
|
|
2731
2731
|
const menuItemModule = {
|
|
2732
2732
|
menuItems: [
|
|
2733
2733
|
{
|
|
2734
|
-
label: config$
|
|
2735
|
-
icon: config$
|
|
2734
|
+
label: config$5.label,
|
|
2735
|
+
icon: config$5.icon,
|
|
2736
|
+
path: "/returns",
|
|
2737
|
+
nested: void 0
|
|
2738
|
+
},
|
|
2739
|
+
{
|
|
2740
|
+
label: config$6.label,
|
|
2741
|
+
icon: config$6.icon,
|
|
2736
2742
|
path: "/refunds",
|
|
2737
2743
|
nested: void 0
|
|
2738
2744
|
},
|
|
2739
2745
|
{
|
|
2740
|
-
label: config$
|
|
2741
|
-
icon: config$
|
|
2746
|
+
label: config$4.label,
|
|
2747
|
+
icon: config$4.icon,
|
|
2742
2748
|
path: "/payments",
|
|
2743
2749
|
nested: void 0
|
|
2744
2750
|
},
|
|
@@ -2749,27 +2755,21 @@ const menuItemModule = {
|
|
|
2749
2755
|
nested: void 0
|
|
2750
2756
|
},
|
|
2751
2757
|
{
|
|
2752
|
-
label: config$
|
|
2753
|
-
icon: config$
|
|
2754
|
-
path: "/returns",
|
|
2758
|
+
label: config$1.label,
|
|
2759
|
+
icon: config$1.icon,
|
|
2760
|
+
path: "/returns/:id",
|
|
2755
2761
|
nested: void 0
|
|
2756
2762
|
},
|
|
2757
2763
|
{
|
|
2758
2764
|
label: config.label,
|
|
2759
2765
|
icon: config.icon,
|
|
2760
|
-
path: "/refunds/:id",
|
|
2761
|
-
nested: void 0
|
|
2762
|
-
},
|
|
2763
|
-
{
|
|
2764
|
-
label: config$1.label,
|
|
2765
|
-
icon: config$1.icon,
|
|
2766
2766
|
path: "/payments/:id",
|
|
2767
2767
|
nested: void 0
|
|
2768
2768
|
},
|
|
2769
2769
|
{
|
|
2770
2770
|
label: config$2.label,
|
|
2771
2771
|
icon: config$2.icon,
|
|
2772
|
-
path: "/
|
|
2772
|
+
path: "/refunds/:id",
|
|
2773
2773
|
nested: void 0
|
|
2774
2774
|
},
|
|
2775
2775
|
{
|