order-management 0.0.83 → 0.0.84
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, CreditCard, Receipt,
|
|
5
|
+
import { CashSolid, PencilSquareSolid, Trash, ArrowPath, CreditCard, Receipt, CheckCircle, ArrowLeft } 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();
|
|
@@ -865,6 +865,238 @@ const useDebounce$3 = (value, delay) => {
|
|
|
865
865
|
return debouncedValue;
|
|
866
866
|
};
|
|
867
867
|
const getStatusBadgeClass$7 = (status) => {
|
|
868
|
+
const statusLower = status.toLowerCase();
|
|
869
|
+
if (statusLower === "requested") {
|
|
870
|
+
return "bg-ui-tag-orange-bg text-ui-tag-orange-text";
|
|
871
|
+
}
|
|
872
|
+
if (statusLower === "received") {
|
|
873
|
+
return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
874
|
+
}
|
|
875
|
+
if (statusLower === "requires_action") {
|
|
876
|
+
return "bg-ui-tag-red-bg text-ui-tag-red-text";
|
|
877
|
+
}
|
|
878
|
+
if (statusLower === "completed") {
|
|
879
|
+
return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
880
|
+
}
|
|
881
|
+
if (statusLower === "canceled") {
|
|
882
|
+
return "bg-ui-tag-grey-bg text-ui-tag-grey-text";
|
|
883
|
+
}
|
|
884
|
+
return "bg-ui-tag-purple-bg text-ui-tag-purple-text";
|
|
885
|
+
};
|
|
886
|
+
const ReturnsPage = () => {
|
|
887
|
+
const navigate = useNavigate();
|
|
888
|
+
const [items, setItems] = useState([]);
|
|
889
|
+
const [statusFilter, setStatusFilter] = useState("all");
|
|
890
|
+
const [createdByFilter, setCreatedByFilter] = useState("all");
|
|
891
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
892
|
+
const debouncedSearchQuery = useDebounce$3(searchQuery, 300);
|
|
893
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
894
|
+
const [isFetchingMore, setIsFetchingMore] = useState(false);
|
|
895
|
+
const [error, setError] = useState(null);
|
|
896
|
+
const [offset, setOffset] = useState(0);
|
|
897
|
+
const [count, setCount] = useState(0);
|
|
898
|
+
const limit = 50;
|
|
899
|
+
const loadReturns = useCallback(
|
|
900
|
+
async (nextOffset, replace = false) => {
|
|
901
|
+
var _a;
|
|
902
|
+
try {
|
|
903
|
+
if (replace) {
|
|
904
|
+
setIsLoading(true);
|
|
905
|
+
} else {
|
|
906
|
+
setIsFetchingMore(true);
|
|
907
|
+
}
|
|
908
|
+
setError(null);
|
|
909
|
+
const params = new URLSearchParams();
|
|
910
|
+
params.set("limit", String(limit));
|
|
911
|
+
params.set("offset", String(nextOffset));
|
|
912
|
+
if (statusFilter !== "all") {
|
|
913
|
+
params.set("status", statusFilter);
|
|
914
|
+
}
|
|
915
|
+
if (debouncedSearchQuery.trim()) {
|
|
916
|
+
params.set("q", debouncedSearchQuery.trim());
|
|
917
|
+
}
|
|
918
|
+
if (createdByFilter !== "all") {
|
|
919
|
+
params.set("created_by", createdByFilter);
|
|
920
|
+
}
|
|
921
|
+
params.set("order", "created_at");
|
|
922
|
+
const response = await fetch(
|
|
923
|
+
`/admin/return?${params.toString()}`,
|
|
924
|
+
{ credentials: "include" }
|
|
925
|
+
);
|
|
926
|
+
if (!response.ok) {
|
|
927
|
+
const message = await response.text();
|
|
928
|
+
throw new Error(message || "Unable to load return orders");
|
|
929
|
+
}
|
|
930
|
+
const payload = await response.json();
|
|
931
|
+
setCount(payload.count ?? 0);
|
|
932
|
+
setOffset(nextOffset + (((_a = payload.returns) == null ? void 0 : _a.length) ?? 0));
|
|
933
|
+
setItems(
|
|
934
|
+
(prev) => replace ? payload.returns ?? [] : [...prev, ...payload.returns ?? []]
|
|
935
|
+
);
|
|
936
|
+
} catch (loadError) {
|
|
937
|
+
const message = loadError instanceof Error ? loadError.message : "Unable to load return orders";
|
|
938
|
+
setError(message);
|
|
939
|
+
} finally {
|
|
940
|
+
setIsLoading(false);
|
|
941
|
+
setIsFetchingMore(false);
|
|
942
|
+
}
|
|
943
|
+
},
|
|
944
|
+
[statusFilter, createdByFilter, debouncedSearchQuery]
|
|
945
|
+
);
|
|
946
|
+
useEffect(() => {
|
|
947
|
+
void loadReturns(0, true);
|
|
948
|
+
}, [statusFilter, createdByFilter, debouncedSearchQuery, loadReturns]);
|
|
949
|
+
const hasMore = useMemo(() => offset < count, [offset, count]);
|
|
950
|
+
const availableStatuses = useMemo(() => {
|
|
951
|
+
const statuses = /* @__PURE__ */ new Set();
|
|
952
|
+
items.forEach((item) => statuses.add(item.status));
|
|
953
|
+
return Array.from(statuses).sort();
|
|
954
|
+
}, [items]);
|
|
955
|
+
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: [
|
|
956
|
+
/* @__PURE__ */ jsxs("header", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
957
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
958
|
+
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "Return Orders" }),
|
|
959
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "View and manage all customer return orders" })
|
|
960
|
+
] }),
|
|
961
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () => loadReturns(0, true), children: "Refresh" })
|
|
962
|
+
] }),
|
|
963
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
964
|
+
/* @__PURE__ */ jsx(
|
|
965
|
+
Input,
|
|
966
|
+
{
|
|
967
|
+
placeholder: "Search by return ID, order ID, or customer email",
|
|
968
|
+
value: searchQuery,
|
|
969
|
+
onChange: (event) => setSearchQuery(event.target.value),
|
|
970
|
+
className: "md:max-w-sm"
|
|
971
|
+
}
|
|
972
|
+
),
|
|
973
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
974
|
+
/* @__PURE__ */ jsxs(
|
|
975
|
+
"select",
|
|
976
|
+
{
|
|
977
|
+
value: createdByFilter,
|
|
978
|
+
onChange: (event) => setCreatedByFilter(event.target.value),
|
|
979
|
+
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",
|
|
980
|
+
children: [
|
|
981
|
+
/* @__PURE__ */ jsx("option", { value: "all", children: "All (Created by)" }),
|
|
982
|
+
/* @__PURE__ */ jsx("option", { value: "customer", children: "Customer" }),
|
|
983
|
+
/* @__PURE__ */ jsx("option", { value: "admin", children: "Admin" })
|
|
984
|
+
]
|
|
985
|
+
}
|
|
986
|
+
),
|
|
987
|
+
/* @__PURE__ */ jsxs(
|
|
988
|
+
"select",
|
|
989
|
+
{
|
|
990
|
+
value: statusFilter,
|
|
991
|
+
onChange: (event) => setStatusFilter(event.target.value),
|
|
992
|
+
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",
|
|
993
|
+
children: [
|
|
994
|
+
/* @__PURE__ */ jsx("option", { value: "all", children: "All Statuses" }),
|
|
995
|
+
availableStatuses.map((status) => /* @__PURE__ */ jsx("option", { value: status, children: status.replace(/_/g, " ").toUpperCase() }, status))
|
|
996
|
+
]
|
|
997
|
+
}
|
|
998
|
+
)
|
|
999
|
+
] })
|
|
1000
|
+
] }),
|
|
1001
|
+
error ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-strong p-6 text-center", children: [
|
|
1002
|
+
/* @__PURE__ */ jsx(Text, { weight: "plus", className: "text-ui-fg-error", children: error }),
|
|
1003
|
+
/* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx(
|
|
1004
|
+
Button,
|
|
1005
|
+
{
|
|
1006
|
+
variant: "secondary",
|
|
1007
|
+
onClick: () => loadReturns(0, true),
|
|
1008
|
+
children: "Try again"
|
|
1009
|
+
}
|
|
1010
|
+
) })
|
|
1011
|
+
] }) : null,
|
|
1012
|
+
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: [
|
|
1013
|
+
/* @__PURE__ */ jsx(Heading, { level: "h3", className: "text-xl", children: "No return orders yet" }),
|
|
1014
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "mt-2 text-ui-fg-subtle", children: "Return orders created by customers will appear here." })
|
|
1015
|
+
] }) : /* @__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: [
|
|
1016
|
+
/* @__PURE__ */ jsx("thead", { className: "bg-ui-bg-subtle", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
1017
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Return ID" }),
|
|
1018
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Order ID" }),
|
|
1019
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Customer" }),
|
|
1020
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Status" }),
|
|
1021
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Refund Amount" }),
|
|
1022
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Created" }),
|
|
1023
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Actions" })
|
|
1024
|
+
] }) }),
|
|
1025
|
+
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-ui-border-subtle", children: items.map((returnOrder) => /* @__PURE__ */ jsxs(
|
|
1026
|
+
"tr",
|
|
1027
|
+
{
|
|
1028
|
+
className: "hover:bg-ui-bg-subtle/60 cursor-pointer",
|
|
1029
|
+
onClick: () => navigate(`/returns/${returnOrder.id}`),
|
|
1030
|
+
children: [
|
|
1031
|
+
/* @__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 }) }) }),
|
|
1032
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: returnOrder.order_id }),
|
|
1033
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: returnOrder.customer_email || returnOrder.order_email || "—" }),
|
|
1034
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4", children: /* @__PURE__ */ jsx(
|
|
1035
|
+
Badge,
|
|
1036
|
+
{
|
|
1037
|
+
size: "2xsmall",
|
|
1038
|
+
className: `uppercase ${getStatusBadgeClass$7(returnOrder.status)}`,
|
|
1039
|
+
children: returnOrder.status.replace(/_/g, " ")
|
|
1040
|
+
}
|
|
1041
|
+
) }),
|
|
1042
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: (() => {
|
|
1043
|
+
const amount = returnOrder.refund_amount;
|
|
1044
|
+
if (amount == null || amount === void 0) {
|
|
1045
|
+
return "—";
|
|
1046
|
+
}
|
|
1047
|
+
const displayAmount = Number(amount) / 100;
|
|
1048
|
+
const currency = returnOrder.currency_code || "$";
|
|
1049
|
+
return `${currency}${displayAmount.toFixed(2)}`;
|
|
1050
|
+
})() }),
|
|
1051
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: new Date(returnOrder.created_at).toLocaleDateString("en-US", {
|
|
1052
|
+
year: "numeric",
|
|
1053
|
+
month: "short",
|
|
1054
|
+
day: "numeric",
|
|
1055
|
+
hour: "numeric",
|
|
1056
|
+
minute: "2-digit",
|
|
1057
|
+
hour12: true
|
|
1058
|
+
}) }),
|
|
1059
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4", children: /* @__PURE__ */ jsx(
|
|
1060
|
+
Button,
|
|
1061
|
+
{
|
|
1062
|
+
variant: "transparent",
|
|
1063
|
+
size: "small",
|
|
1064
|
+
onClick: (e) => {
|
|
1065
|
+
e.stopPropagation();
|
|
1066
|
+
navigate(`/app/orders/${returnOrder.order_id}`);
|
|
1067
|
+
},
|
|
1068
|
+
children: "Go to order"
|
|
1069
|
+
}
|
|
1070
|
+
) })
|
|
1071
|
+
]
|
|
1072
|
+
},
|
|
1073
|
+
returnOrder.id
|
|
1074
|
+
)) })
|
|
1075
|
+
] }) }),
|
|
1076
|
+
hasMore ? /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx(
|
|
1077
|
+
Button,
|
|
1078
|
+
{
|
|
1079
|
+
variant: "secondary",
|
|
1080
|
+
isLoading: isFetchingMore,
|
|
1081
|
+
onClick: () => loadReturns(offset, false),
|
|
1082
|
+
children: "Load more"
|
|
1083
|
+
}
|
|
1084
|
+
) }) : null
|
|
1085
|
+
] }) });
|
|
1086
|
+
};
|
|
1087
|
+
const config$7 = defineRouteConfig({
|
|
1088
|
+
label: "Return Orders",
|
|
1089
|
+
icon: ArrowPath
|
|
1090
|
+
});
|
|
1091
|
+
const useDebounce$2 = (value, delay) => {
|
|
1092
|
+
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
1093
|
+
useEffect(() => {
|
|
1094
|
+
const handler = setTimeout(() => setDebouncedValue(value), delay);
|
|
1095
|
+
return () => clearTimeout(handler);
|
|
1096
|
+
}, [value, delay]);
|
|
1097
|
+
return debouncedValue;
|
|
1098
|
+
};
|
|
1099
|
+
const getStatusBadgeClass$6 = (status) => {
|
|
868
1100
|
const s2 = status.toLowerCase();
|
|
869
1101
|
if (s2 === "captured" || s2 === "completed") return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
870
1102
|
if (s2 === "authorized") return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
@@ -877,7 +1109,7 @@ const PaymentsPage = () => {
|
|
|
877
1109
|
const [items, setItems] = useState([]);
|
|
878
1110
|
const [statusFilter, setStatusFilter] = useState("all");
|
|
879
1111
|
const [orderIdSearch, setOrderIdSearch] = useState("");
|
|
880
|
-
const debouncedOrderId = useDebounce$
|
|
1112
|
+
const debouncedOrderId = useDebounce$2(orderIdSearch, 300);
|
|
881
1113
|
const [isLoading, setIsLoading] = useState(true);
|
|
882
1114
|
const [isFetchingMore, setIsFetchingMore] = useState(false);
|
|
883
1115
|
const [error, setError] = useState(null);
|
|
@@ -997,7 +1229,7 @@ const PaymentsPage = () => {
|
|
|
997
1229
|
Badge,
|
|
998
1230
|
{
|
|
999
1231
|
size: "2xsmall",
|
|
1000
|
-
className: `uppercase ${getStatusBadgeClass$
|
|
1232
|
+
className: `uppercase ${getStatusBadgeClass$6(displayStatus(t))}`,
|
|
1001
1233
|
children: displayStatus(t) !== "—" ? displayStatus(t).replace(/_/g, " ") : "—"
|
|
1002
1234
|
}
|
|
1003
1235
|
) }),
|
|
@@ -1052,11 +1284,11 @@ const PaymentsPage = () => {
|
|
|
1052
1284
|
) }) : null
|
|
1053
1285
|
] }) });
|
|
1054
1286
|
};
|
|
1055
|
-
const config$
|
|
1287
|
+
const config$6 = defineRouteConfig({
|
|
1056
1288
|
label: "Payments",
|
|
1057
1289
|
icon: CreditCard
|
|
1058
1290
|
});
|
|
1059
|
-
const useDebounce$
|
|
1291
|
+
const useDebounce$1 = (value, delay) => {
|
|
1060
1292
|
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
1061
1293
|
useEffect(() => {
|
|
1062
1294
|
const handler = setTimeout(() => setDebouncedValue(value), delay);
|
|
@@ -1064,7 +1296,7 @@ const useDebounce$2 = (value, delay) => {
|
|
|
1064
1296
|
}, [value, delay]);
|
|
1065
1297
|
return debouncedValue;
|
|
1066
1298
|
};
|
|
1067
|
-
const getStatusBadgeClass$
|
|
1299
|
+
const getStatusBadgeClass$5 = (status) => {
|
|
1068
1300
|
const s2 = status.toLowerCase();
|
|
1069
1301
|
if (s2 === "captured" || s2 === "completed") return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
1070
1302
|
if (s2 === "authorized") return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
@@ -1076,12 +1308,12 @@ const RefundsPage = () => {
|
|
|
1076
1308
|
const navigate = useNavigate();
|
|
1077
1309
|
const [items, setItems] = useState([]);
|
|
1078
1310
|
const [orderIdSearch, setOrderIdSearch] = useState("");
|
|
1079
|
-
const debouncedOrderId = useDebounce$
|
|
1311
|
+
const debouncedOrderId = useDebounce$1(orderIdSearch, 300);
|
|
1080
1312
|
const [paymentStatusFilter, setPaymentStatusFilter] = useState("all");
|
|
1081
1313
|
const [providerSearch, setProviderSearch] = useState("");
|
|
1082
|
-
const debouncedProvider = useDebounce$
|
|
1314
|
+
const debouncedProvider = useDebounce$1(providerSearch, 300);
|
|
1083
1315
|
const [currencySearch, setCurrencySearch] = useState("");
|
|
1084
|
-
const debouncedCurrency = useDebounce$
|
|
1316
|
+
const debouncedCurrency = useDebounce$1(currencySearch, 300);
|
|
1085
1317
|
const [dateFrom, setDateFrom] = useState("");
|
|
1086
1318
|
const [dateTo, setDateTo] = useState("");
|
|
1087
1319
|
const [amountMin, setAmountMin] = useState("");
|
|
@@ -1293,7 +1525,7 @@ const RefundsPage = () => {
|
|
|
1293
1525
|
Badge,
|
|
1294
1526
|
{
|
|
1295
1527
|
size: "2xsmall",
|
|
1296
|
-
className: `uppercase ${getStatusBadgeClass$
|
|
1528
|
+
className: `uppercase ${getStatusBadgeClass$5(displayStatus(r))}`,
|
|
1297
1529
|
children: displayStatus(r) !== "—" ? displayStatus(r).replace(/_/g, " ") : "—"
|
|
1298
1530
|
}
|
|
1299
1531
|
) }),
|
|
@@ -1347,11 +1579,11 @@ const RefundsPage = () => {
|
|
|
1347
1579
|
) }) : null
|
|
1348
1580
|
] }) });
|
|
1349
1581
|
};
|
|
1350
|
-
const config$
|
|
1582
|
+
const config$5 = defineRouteConfig({
|
|
1351
1583
|
label: "Refunds",
|
|
1352
1584
|
icon: Receipt
|
|
1353
1585
|
});
|
|
1354
|
-
const useDebounce
|
|
1586
|
+
const useDebounce = (value, delay) => {
|
|
1355
1587
|
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
1356
1588
|
useEffect(() => {
|
|
1357
1589
|
const handler = setTimeout(() => setDebouncedValue(value), delay);
|
|
@@ -1359,39 +1591,39 @@ const useDebounce$1 = (value, delay) => {
|
|
|
1359
1591
|
}, [value, delay]);
|
|
1360
1592
|
return debouncedValue;
|
|
1361
1593
|
};
|
|
1362
|
-
const getStatusBadgeClass$
|
|
1594
|
+
const getStatusBadgeClass$4 = (status) => {
|
|
1363
1595
|
const statusLower = status.toLowerCase();
|
|
1364
1596
|
if (statusLower === "requested") {
|
|
1365
1597
|
return "bg-ui-tag-orange-bg text-ui-tag-orange-text";
|
|
1366
1598
|
}
|
|
1367
|
-
if (statusLower === "
|
|
1599
|
+
if (statusLower === "approved") {
|
|
1368
1600
|
return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
1369
1601
|
}
|
|
1370
|
-
if (statusLower === "
|
|
1602
|
+
if (statusLower === "rejected") {
|
|
1371
1603
|
return "bg-ui-tag-red-bg text-ui-tag-red-text";
|
|
1372
1604
|
}
|
|
1373
1605
|
if (statusLower === "completed") {
|
|
1374
1606
|
return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
1375
1607
|
}
|
|
1376
|
-
if (statusLower === "
|
|
1608
|
+
if (statusLower === "cancelled") {
|
|
1377
1609
|
return "bg-ui-tag-grey-bg text-ui-tag-grey-text";
|
|
1378
1610
|
}
|
|
1379
1611
|
return "bg-ui-tag-purple-bg text-ui-tag-purple-text";
|
|
1380
1612
|
};
|
|
1381
|
-
const
|
|
1613
|
+
const SwapsPage = () => {
|
|
1382
1614
|
const navigate = useNavigate();
|
|
1383
1615
|
const [items, setItems] = useState([]);
|
|
1384
1616
|
const [statusFilter, setStatusFilter] = useState("all");
|
|
1385
1617
|
const [createdByFilter, setCreatedByFilter] = useState("all");
|
|
1386
1618
|
const [searchQuery, setSearchQuery] = useState("");
|
|
1387
|
-
const debouncedSearchQuery = useDebounce
|
|
1619
|
+
const debouncedSearchQuery = useDebounce(searchQuery, 300);
|
|
1388
1620
|
const [isLoading, setIsLoading] = useState(true);
|
|
1389
1621
|
const [isFetchingMore, setIsFetchingMore] = useState(false);
|
|
1390
1622
|
const [error, setError] = useState(null);
|
|
1391
1623
|
const [offset, setOffset] = useState(0);
|
|
1392
1624
|
const [count, setCount] = useState(0);
|
|
1393
1625
|
const limit = 50;
|
|
1394
|
-
const
|
|
1626
|
+
const loadSwaps = useCallback(
|
|
1395
1627
|
async (nextOffset, replace = false) => {
|
|
1396
1628
|
var _a;
|
|
1397
1629
|
try {
|
|
@@ -1408,28 +1640,27 @@ const ReturnsPage = () => {
|
|
|
1408
1640
|
params.set("status", statusFilter);
|
|
1409
1641
|
}
|
|
1410
1642
|
if (debouncedSearchQuery.trim()) {
|
|
1411
|
-
params.set("
|
|
1643
|
+
params.set("order_id", debouncedSearchQuery.trim());
|
|
1412
1644
|
}
|
|
1413
1645
|
if (createdByFilter !== "all") {
|
|
1414
1646
|
params.set("created_by", createdByFilter);
|
|
1415
1647
|
}
|
|
1416
|
-
params.set("order", "created_at");
|
|
1417
1648
|
const response = await fetch(
|
|
1418
|
-
`/admin/
|
|
1649
|
+
`/admin/swaps?${params.toString()}`,
|
|
1419
1650
|
{ credentials: "include" }
|
|
1420
1651
|
);
|
|
1421
1652
|
if (!response.ok) {
|
|
1422
1653
|
const message = await response.text();
|
|
1423
|
-
throw new Error(message || "Unable to load
|
|
1654
|
+
throw new Error(message || "Unable to load swaps");
|
|
1424
1655
|
}
|
|
1425
1656
|
const payload = await response.json();
|
|
1426
1657
|
setCount(payload.count ?? 0);
|
|
1427
|
-
setOffset(nextOffset + (((_a = payload.
|
|
1658
|
+
setOffset(nextOffset + (((_a = payload.swaps) == null ? void 0 : _a.length) ?? 0));
|
|
1428
1659
|
setItems(
|
|
1429
|
-
(prev) => replace ? payload.
|
|
1660
|
+
(prev) => replace ? payload.swaps ?? [] : [...prev, ...payload.swaps ?? []]
|
|
1430
1661
|
);
|
|
1431
1662
|
} catch (loadError) {
|
|
1432
|
-
const message = loadError instanceof Error ? loadError.message : "Unable to load
|
|
1663
|
+
const message = loadError instanceof Error ? loadError.message : "Unable to load swaps";
|
|
1433
1664
|
setError(message);
|
|
1434
1665
|
} finally {
|
|
1435
1666
|
setIsLoading(false);
|
|
@@ -1439,8 +1670,8 @@ const ReturnsPage = () => {
|
|
|
1439
1670
|
[statusFilter, createdByFilter, debouncedSearchQuery]
|
|
1440
1671
|
);
|
|
1441
1672
|
useEffect(() => {
|
|
1442
|
-
void
|
|
1443
|
-
}, [statusFilter, createdByFilter, debouncedSearchQuery,
|
|
1673
|
+
void loadSwaps(0, true);
|
|
1674
|
+
}, [statusFilter, createdByFilter, debouncedSearchQuery, loadSwaps]);
|
|
1444
1675
|
const hasMore = useMemo(() => offset < count, [offset, count]);
|
|
1445
1676
|
const availableStatuses = useMemo(() => {
|
|
1446
1677
|
const statuses = /* @__PURE__ */ new Set();
|
|
@@ -1450,16 +1681,16 @@ const ReturnsPage = () => {
|
|
|
1450
1681
|
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: [
|
|
1451
1682
|
/* @__PURE__ */ jsxs("header", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
1452
1683
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
1453
|
-
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "
|
|
1454
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "View and manage all customer
|
|
1684
|
+
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "Exchanges" }),
|
|
1685
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "View and manage all customer exchange requests" })
|
|
1455
1686
|
] }),
|
|
1456
|
-
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () =>
|
|
1687
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () => loadSwaps(0, true), children: "Refresh" })
|
|
1457
1688
|
] }),
|
|
1458
1689
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
1459
1690
|
/* @__PURE__ */ jsx(
|
|
1460
1691
|
Input,
|
|
1461
1692
|
{
|
|
1462
|
-
placeholder: "Search by
|
|
1693
|
+
placeholder: "Search by swap ID or order ID",
|
|
1463
1694
|
value: searchQuery,
|
|
1464
1695
|
onChange: (event) => setSearchQuery(event.target.value),
|
|
1465
1696
|
className: "md:max-w-sm"
|
|
@@ -1499,51 +1730,50 @@ const ReturnsPage = () => {
|
|
|
1499
1730
|
Button,
|
|
1500
1731
|
{
|
|
1501
1732
|
variant: "secondary",
|
|
1502
|
-
onClick: () =>
|
|
1733
|
+
onClick: () => loadSwaps(0, true),
|
|
1503
1734
|
children: "Try again"
|
|
1504
1735
|
}
|
|
1505
1736
|
) })
|
|
1506
1737
|
] }) : null,
|
|
1507
|
-
isLoading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading
|
|
1508
|
-
/* @__PURE__ */ jsx(Heading, { level: "h3", className: "text-xl", children: "No
|
|
1509
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "mt-2 text-ui-fg-subtle", children: "
|
|
1738
|
+
isLoading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading swaps..." }) }) : items.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-dashed border-ui-border-strong p-10 text-center", children: [
|
|
1739
|
+
/* @__PURE__ */ jsx(Heading, { level: "h3", className: "text-xl", children: "No exchanges yet" }),
|
|
1740
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "mt-2 text-ui-fg-subtle", children: "Exchange requests created by customers will appear here." })
|
|
1510
1741
|
] }) : /* @__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: [
|
|
1511
1742
|
/* @__PURE__ */ jsx("thead", { className: "bg-ui-bg-subtle", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
1512
|
-
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "
|
|
1743
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Exchange ID" }),
|
|
1513
1744
|
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Order ID" }),
|
|
1514
|
-
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Customer" }),
|
|
1515
1745
|
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Status" }),
|
|
1516
|
-
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "
|
|
1746
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Difference Due" }),
|
|
1517
1747
|
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Created" }),
|
|
1518
1748
|
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Actions" })
|
|
1519
1749
|
] }) }),
|
|
1520
|
-
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-ui-border-subtle", children: items.map((
|
|
1750
|
+
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-ui-border-subtle", children: items.map((swap) => /* @__PURE__ */ jsxs(
|
|
1521
1751
|
"tr",
|
|
1522
1752
|
{
|
|
1523
1753
|
className: "hover:bg-ui-bg-subtle/60 cursor-pointer",
|
|
1524
|
-
onClick: () => navigate(`/
|
|
1754
|
+
onClick: () => navigate(`/swaps/${swap.id}`),
|
|
1525
1755
|
children: [
|
|
1526
|
-
/* @__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:
|
|
1527
|
-
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children:
|
|
1528
|
-
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: returnOrder.customer_email || returnOrder.order_email || "—" }),
|
|
1756
|
+
/* @__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: swap.id }) }) }),
|
|
1757
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: swap.order_id }),
|
|
1529
1758
|
/* @__PURE__ */ jsx("td", { className: "px-4 py-4", children: /* @__PURE__ */ jsx(
|
|
1530
1759
|
Badge,
|
|
1531
1760
|
{
|
|
1532
1761
|
size: "2xsmall",
|
|
1533
|
-
className: `uppercase ${getStatusBadgeClass$
|
|
1534
|
-
children:
|
|
1762
|
+
className: `uppercase ${getStatusBadgeClass$4(swap.status)}`,
|
|
1763
|
+
children: swap.status.replace(/_/g, " ")
|
|
1535
1764
|
}
|
|
1536
1765
|
) }),
|
|
1537
1766
|
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: (() => {
|
|
1538
|
-
const amount =
|
|
1767
|
+
const amount = swap.difference_due;
|
|
1539
1768
|
if (amount == null || amount === void 0) {
|
|
1540
1769
|
return "—";
|
|
1541
1770
|
}
|
|
1542
1771
|
const displayAmount = Number(amount) / 100;
|
|
1543
|
-
const currency =
|
|
1544
|
-
|
|
1772
|
+
const currency = swap.currency_code || "$";
|
|
1773
|
+
const sign = displayAmount >= 0 ? "+" : "";
|
|
1774
|
+
return `${sign}${currency}${displayAmount.toFixed(2)}`;
|
|
1545
1775
|
})() }),
|
|
1546
|
-
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: new Date(
|
|
1776
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: new Date(swap.created_at).toLocaleDateString("en-US", {
|
|
1547
1777
|
year: "numeric",
|
|
1548
1778
|
month: "short",
|
|
1549
1779
|
day: "numeric",
|
|
@@ -1558,14 +1788,14 @@ const ReturnsPage = () => {
|
|
|
1558
1788
|
size: "small",
|
|
1559
1789
|
onClick: (e) => {
|
|
1560
1790
|
e.stopPropagation();
|
|
1561
|
-
navigate(`/app/orders/${
|
|
1791
|
+
navigate(`/app/orders/${swap.order_id}`);
|
|
1562
1792
|
},
|
|
1563
1793
|
children: "Go to order"
|
|
1564
1794
|
}
|
|
1565
1795
|
) })
|
|
1566
1796
|
]
|
|
1567
1797
|
},
|
|
1568
|
-
|
|
1798
|
+
swap.id
|
|
1569
1799
|
)) })
|
|
1570
1800
|
] }) }),
|
|
1571
1801
|
hasMore ? /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx(
|
|
@@ -1573,25 +1803,17 @@ const ReturnsPage = () => {
|
|
|
1573
1803
|
{
|
|
1574
1804
|
variant: "secondary",
|
|
1575
1805
|
isLoading: isFetchingMore,
|
|
1576
|
-
onClick: () =>
|
|
1806
|
+
onClick: () => loadSwaps(offset, false),
|
|
1577
1807
|
children: "Load more"
|
|
1578
1808
|
}
|
|
1579
1809
|
) }) : null
|
|
1580
1810
|
] }) });
|
|
1581
1811
|
};
|
|
1582
|
-
const config$
|
|
1583
|
-
label: "
|
|
1812
|
+
const config$4 = defineRouteConfig({
|
|
1813
|
+
label: "Exchanges",
|
|
1584
1814
|
icon: ArrowPath
|
|
1585
1815
|
});
|
|
1586
|
-
const
|
|
1587
|
-
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
1588
|
-
useEffect(() => {
|
|
1589
|
-
const handler = setTimeout(() => setDebouncedValue(value), delay);
|
|
1590
|
-
return () => clearTimeout(handler);
|
|
1591
|
-
}, [value, delay]);
|
|
1592
|
-
return debouncedValue;
|
|
1593
|
-
};
|
|
1594
|
-
const getStatusBadgeClass$4 = (status) => {
|
|
1816
|
+
const getStatusBadgeClass$3 = (status) => {
|
|
1595
1817
|
const statusLower = status.toLowerCase();
|
|
1596
1818
|
if (statusLower === "requested") {
|
|
1597
1819
|
return "bg-ui-tag-orange-bg text-ui-tag-orange-text";
|
|
@@ -1602,6 +1824,12 @@ const getStatusBadgeClass$4 = (status) => {
|
|
|
1602
1824
|
if (statusLower === "rejected") {
|
|
1603
1825
|
return "bg-ui-tag-red-bg text-ui-tag-red-text";
|
|
1604
1826
|
}
|
|
1827
|
+
if (statusLower === "received") {
|
|
1828
|
+
return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
1829
|
+
}
|
|
1830
|
+
if (statusLower === "refunded") {
|
|
1831
|
+
return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
1832
|
+
}
|
|
1605
1833
|
if (statusLower === "completed") {
|
|
1606
1834
|
return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
1607
1835
|
}
|
|
@@ -1610,210 +1838,260 @@ const getStatusBadgeClass$4 = (status) => {
|
|
|
1610
1838
|
}
|
|
1611
1839
|
return "bg-ui-tag-purple-bg text-ui-tag-purple-text";
|
|
1612
1840
|
};
|
|
1613
|
-
const
|
|
1841
|
+
const ReturnDetailPage = () => {
|
|
1842
|
+
var _a, _b;
|
|
1614
1843
|
const navigate = useNavigate();
|
|
1615
|
-
const
|
|
1616
|
-
const [
|
|
1617
|
-
const [createdByFilter, setCreatedByFilter] = useState("all");
|
|
1618
|
-
const [searchQuery, setSearchQuery] = useState("");
|
|
1619
|
-
const debouncedSearchQuery = useDebounce(searchQuery, 300);
|
|
1844
|
+
const { id } = useParams();
|
|
1845
|
+
const [returnOrder, setReturnOrder] = useState(null);
|
|
1620
1846
|
const [isLoading, setIsLoading] = useState(true);
|
|
1621
|
-
const [
|
|
1847
|
+
const [isRejecting, setIsRejecting] = useState(false);
|
|
1622
1848
|
const [error, setError] = useState(null);
|
|
1623
|
-
const [
|
|
1624
|
-
const [
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1849
|
+
const [updateError, setUpdateError] = useState(null);
|
|
1850
|
+
const [updateSuccess, setUpdateSuccess] = useState(false);
|
|
1851
|
+
useEffect(() => {
|
|
1852
|
+
if (!id) {
|
|
1853
|
+
navigate("/returns");
|
|
1854
|
+
return;
|
|
1855
|
+
}
|
|
1856
|
+
const loadReturn = async () => {
|
|
1629
1857
|
try {
|
|
1630
|
-
|
|
1631
|
-
setIsLoading(true);
|
|
1632
|
-
} else {
|
|
1633
|
-
setIsFetchingMore(true);
|
|
1634
|
-
}
|
|
1858
|
+
setIsLoading(true);
|
|
1635
1859
|
setError(null);
|
|
1636
|
-
const
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
if (statusFilter !== "all") {
|
|
1640
|
-
params.set("status", statusFilter);
|
|
1641
|
-
}
|
|
1642
|
-
if (debouncedSearchQuery.trim()) {
|
|
1643
|
-
params.set("order_id", debouncedSearchQuery.trim());
|
|
1644
|
-
}
|
|
1645
|
-
if (createdByFilter !== "all") {
|
|
1646
|
-
params.set("created_by", createdByFilter);
|
|
1647
|
-
}
|
|
1648
|
-
const response = await fetch(
|
|
1649
|
-
`/admin/swaps?${params.toString()}`,
|
|
1650
|
-
{ credentials: "include" }
|
|
1651
|
-
);
|
|
1860
|
+
const response = await fetch(`/admin/returns/${id}`, {
|
|
1861
|
+
credentials: "include"
|
|
1862
|
+
});
|
|
1652
1863
|
if (!response.ok) {
|
|
1653
1864
|
const message = await response.text();
|
|
1654
|
-
throw new Error(message || "Unable to load
|
|
1865
|
+
throw new Error(message || "Unable to load return order");
|
|
1655
1866
|
}
|
|
1656
1867
|
const payload = await response.json();
|
|
1657
|
-
|
|
1658
|
-
setOffset(nextOffset + (((_a = payload.swaps) == null ? void 0 : _a.length) ?? 0));
|
|
1659
|
-
setItems(
|
|
1660
|
-
(prev) => replace ? payload.swaps ?? [] : [...prev, ...payload.swaps ?? []]
|
|
1661
|
-
);
|
|
1868
|
+
setReturnOrder(payload.return);
|
|
1662
1869
|
} catch (loadError) {
|
|
1663
|
-
const message = loadError instanceof Error ? loadError.message : "Unable to load
|
|
1870
|
+
const message = loadError instanceof Error ? loadError.message : "Unable to load return order";
|
|
1664
1871
|
setError(message);
|
|
1665
1872
|
} finally {
|
|
1666
1873
|
setIsLoading(false);
|
|
1667
|
-
setIsFetchingMore(false);
|
|
1668
1874
|
}
|
|
1669
|
-
}
|
|
1670
|
-
|
|
1671
|
-
);
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1875
|
+
};
|
|
1876
|
+
void loadReturn();
|
|
1877
|
+
}, [id, navigate]);
|
|
1878
|
+
const handleReject = async () => {
|
|
1879
|
+
if (!id) {
|
|
1880
|
+
return;
|
|
1881
|
+
}
|
|
1882
|
+
try {
|
|
1883
|
+
setIsRejecting(true);
|
|
1884
|
+
setUpdateError(null);
|
|
1885
|
+
setUpdateSuccess(false);
|
|
1886
|
+
const response = await fetch(`/admin/returns/${id}/reject`, {
|
|
1887
|
+
method: "POST",
|
|
1888
|
+
headers: {
|
|
1889
|
+
"Content-Type": "application/json"
|
|
1890
|
+
},
|
|
1891
|
+
credentials: "include",
|
|
1892
|
+
body: JSON.stringify({ reason: "Rejected by admin" })
|
|
1893
|
+
});
|
|
1894
|
+
if (!response.ok) {
|
|
1895
|
+
const message = await response.text();
|
|
1896
|
+
throw new Error(message || "Unable to reject return");
|
|
1897
|
+
}
|
|
1898
|
+
const payload = await response.json();
|
|
1899
|
+
setReturnOrder(payload.return);
|
|
1900
|
+
setUpdateSuccess(true);
|
|
1901
|
+
setTimeout(() => setUpdateSuccess(false), 3e3);
|
|
1902
|
+
const detailResponse = await fetch(`/admin/returns/${id}`, {
|
|
1903
|
+
credentials: "include"
|
|
1904
|
+
});
|
|
1905
|
+
if (detailResponse.ok) {
|
|
1906
|
+
const detailPayload = await detailResponse.json();
|
|
1907
|
+
setReturnOrder(detailPayload.return);
|
|
1908
|
+
}
|
|
1909
|
+
} catch (updateErr) {
|
|
1910
|
+
const message = updateErr instanceof Error ? updateErr.message : "Unable to reject return";
|
|
1911
|
+
setUpdateError(message);
|
|
1912
|
+
} finally {
|
|
1913
|
+
setIsRejecting(false);
|
|
1914
|
+
}
|
|
1915
|
+
};
|
|
1916
|
+
if (isLoading) {
|
|
1917
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full p-6", children: /* @__PURE__ */ jsx(Container, { className: "mx-auto flex w-full max-w-5xl flex-col gap-6 p-6", children: /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading return order..." }) }) }) });
|
|
1918
|
+
}
|
|
1919
|
+
if (error || !returnOrder) {
|
|
1920
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full p-6", children: /* @__PURE__ */ jsx(Container, { className: "mx-auto flex w-full max-w-5xl flex-col gap-6 p-6", children: /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-strong p-6 text-center", children: [
|
|
1921
|
+
/* @__PURE__ */ jsx(Text, { weight: "plus", className: "text-ui-fg-error", children: error || "Return order not found" }),
|
|
1922
|
+
/* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: () => navigate("/returns"), children: "Back to list" }) })
|
|
1923
|
+
] }) }) });
|
|
1924
|
+
}
|
|
1925
|
+
const statusHistory = ((_a = returnOrder.metadata) == null ? void 0 : _a.status_history) || [];
|
|
1926
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full p-6", children: /* @__PURE__ */ jsxs(Container, { className: "mx-auto flex w-full max-w-5xl flex-col gap-6 p-6", children: [
|
|
1927
|
+
/* @__PURE__ */ jsxs("header", { className: "flex flex-col gap-3", children: [
|
|
1928
|
+
/* @__PURE__ */ jsxs(
|
|
1929
|
+
Button,
|
|
1692
1930
|
{
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
className: "
|
|
1931
|
+
variant: "transparent",
|
|
1932
|
+
size: "small",
|
|
1933
|
+
onClick: () => navigate("/returns"),
|
|
1934
|
+
className: "w-fit",
|
|
1935
|
+
children: [
|
|
1936
|
+
/* @__PURE__ */ jsx(ArrowLeft, { className: "mr-2" }),
|
|
1937
|
+
"Back to list"
|
|
1938
|
+
]
|
|
1697
1939
|
}
|
|
1698
1940
|
),
|
|
1699
|
-
/* @__PURE__ */ jsxs("div", { className: "flex gap-
|
|
1700
|
-
/* @__PURE__ */ jsxs(
|
|
1701
|
-
"
|
|
1941
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 md:flex-row md:items-center md:justify-between", children: [
|
|
1942
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
1943
|
+
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "Return Order Details" }),
|
|
1944
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: returnOrder.id })
|
|
1945
|
+
] }),
|
|
1946
|
+
/* @__PURE__ */ jsx(
|
|
1947
|
+
Badge,
|
|
1702
1948
|
{
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
children: [
|
|
1707
|
-
/* @__PURE__ */ jsx("option", { value: "all", children: "All (Created by)" }),
|
|
1708
|
-
/* @__PURE__ */ jsx("option", { value: "customer", children: "Customer" }),
|
|
1709
|
-
/* @__PURE__ */ jsx("option", { value: "admin", children: "Admin" })
|
|
1710
|
-
]
|
|
1711
|
-
}
|
|
1712
|
-
),
|
|
1713
|
-
/* @__PURE__ */ jsxs(
|
|
1714
|
-
"select",
|
|
1715
|
-
{
|
|
1716
|
-
value: statusFilter,
|
|
1717
|
-
onChange: (event) => setStatusFilter(event.target.value),
|
|
1718
|
-
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",
|
|
1719
|
-
children: [
|
|
1720
|
-
/* @__PURE__ */ jsx("option", { value: "all", children: "All Statuses" }),
|
|
1721
|
-
availableStatuses.map((status) => /* @__PURE__ */ jsx("option", { value: status, children: status.replace(/_/g, " ").toUpperCase() }, status))
|
|
1722
|
-
]
|
|
1949
|
+
size: "small",
|
|
1950
|
+
className: `uppercase ${getStatusBadgeClass$3(returnOrder.status)}`,
|
|
1951
|
+
children: returnOrder.status.replace(/_/g, " ")
|
|
1723
1952
|
}
|
|
1724
1953
|
)
|
|
1725
1954
|
] })
|
|
1726
1955
|
] }),
|
|
1727
|
-
|
|
1728
|
-
/* @__PURE__ */ jsx(
|
|
1729
|
-
/* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx(
|
|
1956
|
+
returnOrder.status === "requested" && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
1957
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-3", children: /* @__PURE__ */ jsx(
|
|
1730
1958
|
Button,
|
|
1731
1959
|
{
|
|
1732
|
-
variant: "
|
|
1733
|
-
onClick:
|
|
1734
|
-
|
|
1960
|
+
variant: "danger",
|
|
1961
|
+
onClick: handleReject,
|
|
1962
|
+
disabled: isRejecting,
|
|
1963
|
+
isLoading: isRejecting,
|
|
1964
|
+
children: "Reject (Cancel) Return"
|
|
1735
1965
|
}
|
|
1736
|
-
) })
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
/* @__PURE__ */ jsx(
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
/* @__PURE__ */ jsx("
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
/* @__PURE__ */ jsx(
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1966
|
+
) }),
|
|
1967
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: 'Cancel this return request. Use "Mark as received" when items are received.' })
|
|
1968
|
+
] }),
|
|
1969
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-base p-6", children: [
|
|
1970
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "mb-4 text-lg", children: "Return Information" }),
|
|
1971
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
1972
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1973
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Return ID" }),
|
|
1974
|
+
/* @__PURE__ */ jsx(Text, { className: "font-medium", children: returnOrder.id })
|
|
1975
|
+
] }),
|
|
1976
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
1977
|
+
Button,
|
|
1978
|
+
{
|
|
1979
|
+
variant: "secondary",
|
|
1980
|
+
onClick: () => {
|
|
1981
|
+
window.open(
|
|
1982
|
+
`/app/orders/${returnOrder.order_id}`,
|
|
1983
|
+
"_blank"
|
|
1984
|
+
);
|
|
1985
|
+
},
|
|
1986
|
+
children: "View order"
|
|
1987
|
+
}
|
|
1988
|
+
) })
|
|
1989
|
+
] })
|
|
1990
|
+
] }),
|
|
1991
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-6 md:grid-cols-2", children: [
|
|
1992
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-base p-6", children: [
|
|
1993
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "mb-4 text-lg", children: "Return Details" }),
|
|
1994
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
1995
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1996
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Return ID" }),
|
|
1997
|
+
/* @__PURE__ */ jsx(Text, { className: "font-medium", children: returnOrder.id })
|
|
1998
|
+
] }),
|
|
1999
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2000
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Status" }),
|
|
2001
|
+
/* @__PURE__ */ jsx(Text, { className: "font-medium", children: returnOrder.status })
|
|
2002
|
+
] }),
|
|
2003
|
+
returnOrder.reason && /* @__PURE__ */ jsxs("div", { children: [
|
|
2004
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Reason" }),
|
|
2005
|
+
/* @__PURE__ */ jsx(Text, { className: "font-medium", children: returnOrder.reason })
|
|
2006
|
+
] }),
|
|
2007
|
+
returnOrder.note && /* @__PURE__ */ jsxs("div", { children: [
|
|
2008
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Note" }),
|
|
2009
|
+
/* @__PURE__ */ jsx(Text, { className: "font-medium", children: returnOrder.note })
|
|
2010
|
+
] }),
|
|
2011
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2012
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Created" }),
|
|
2013
|
+
/* @__PURE__ */ jsx(Text, { className: "font-medium", children: new Date(returnOrder.created_at).toLocaleString() })
|
|
2014
|
+
] }),
|
|
2015
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2016
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Last Updated" }),
|
|
2017
|
+
/* @__PURE__ */ jsx(Text, { className: "font-medium", children: new Date(returnOrder.updated_at).toLocaleString() })
|
|
2018
|
+
] })
|
|
2019
|
+
] })
|
|
2020
|
+
] }),
|
|
2021
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-base p-6", children: [
|
|
2022
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "mb-4 text-lg", children: "Status History" }),
|
|
2023
|
+
statusHistory.length > 0 ? /* @__PURE__ */ jsx("div", { className: "space-y-2", children: statusHistory.map((entry, index) => /* @__PURE__ */ jsx(
|
|
2024
|
+
"div",
|
|
2025
|
+
{
|
|
2026
|
+
className: "flex items-center justify-between border-b border-ui-border-subtle pb-2 last:border-0",
|
|
2027
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
2028
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(
|
|
2029
|
+
Badge,
|
|
2030
|
+
{
|
|
2031
|
+
size: "2xsmall",
|
|
2032
|
+
className: `uppercase ${getStatusBadgeClass$3(entry.status)}`,
|
|
2033
|
+
children: entry.status.replace(/_/g, " ")
|
|
2034
|
+
}
|
|
2035
|
+
) }),
|
|
2036
|
+
/* @__PURE__ */ jsxs(Text, { size: "small", className: "text-ui-fg-subtle", children: [
|
|
2037
|
+
new Date(entry.timestamp).toLocaleString(),
|
|
2038
|
+
entry.admin_id && ` by ${entry.admin_id}`,
|
|
2039
|
+
entry.reason && ` - ${entry.reason}`
|
|
2040
|
+
] })
|
|
2041
|
+
] })
|
|
2042
|
+
},
|
|
2043
|
+
index
|
|
2044
|
+
)) }) : /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "No status history available" })
|
|
2045
|
+
] })
|
|
2046
|
+
] }),
|
|
2047
|
+
returnOrder.order && /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-base p-6", children: [
|
|
2048
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "mb-4 text-lg", children: "Related Order Information" }),
|
|
2049
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
2050
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2051
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Order ID" }),
|
|
2052
|
+
/* @__PURE__ */ jsx(Text, { className: "font-medium", children: returnOrder.order.id })
|
|
2053
|
+
] }),
|
|
2054
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2055
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Order Status" }),
|
|
2056
|
+
/* @__PURE__ */ jsx(Text, { className: "font-medium", children: returnOrder.order.status || "—" })
|
|
2057
|
+
] }),
|
|
2058
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2059
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Customer" }),
|
|
2060
|
+
/* @__PURE__ */ jsx(Text, { className: "font-medium", children: ((_b = returnOrder.order.customer) == null ? void 0 : _b.email) || returnOrder.order.email || "—" })
|
|
2061
|
+
] }),
|
|
2062
|
+
returnOrder.order.total && /* @__PURE__ */ jsxs("div", { children: [
|
|
2063
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Order Total" }),
|
|
2064
|
+
/* @__PURE__ */ jsxs(Text, { className: "font-medium", children: [
|
|
2065
|
+
returnOrder.order.currency_code || "$",
|
|
2066
|
+
(Number(returnOrder.order.total) / 100).toFixed(2)
|
|
2067
|
+
] })
|
|
2068
|
+
] })
|
|
2069
|
+
] })
|
|
2070
|
+
] }),
|
|
2071
|
+
returnOrder.return_items && returnOrder.return_items.length > 0 && /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-base p-6", children: [
|
|
2072
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "mb-4 text-lg", children: "Return Items" }),
|
|
2073
|
+
/* @__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: [
|
|
2074
|
+
/* @__PURE__ */ jsx("thead", { className: "bg-ui-bg-subtle", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
2075
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Item ID" }),
|
|
2076
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Quantity" }),
|
|
2077
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Reason" })
|
|
2078
|
+
] }) }),
|
|
2079
|
+
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-ui-border-subtle", children: returnOrder.return_items.map((item, index) => /* @__PURE__ */ jsxs("tr", { children: [
|
|
2080
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 font-medium text-ui-fg-base", children: item.id }),
|
|
2081
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: item.quantity }),
|
|
2082
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: item.reason || "—" })
|
|
2083
|
+
] }, item.id || index)) })
|
|
2084
|
+
] }) })
|
|
2085
|
+
] }),
|
|
2086
|
+
updateError && /* @__PURE__ */ jsx("div", { className: "rounded-lg border border-ui-border-error bg-ui-bg-error-subtle p-4", children: /* @__PURE__ */ jsx(Text, { className: "text-ui-fg-error", children: updateError }) }),
|
|
2087
|
+
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" }) })
|
|
1810
2088
|
] }) });
|
|
1811
2089
|
};
|
|
1812
|
-
const config$
|
|
1813
|
-
label: "
|
|
1814
|
-
icon:
|
|
2090
|
+
const config$3 = defineRouteConfig({
|
|
2091
|
+
label: "Return Order Details",
|
|
2092
|
+
icon: CheckCircle
|
|
1815
2093
|
});
|
|
1816
|
-
const getStatusBadgeClass$
|
|
2094
|
+
const getStatusBadgeClass$2 = (status) => {
|
|
1817
2095
|
const s2 = status.toLowerCase();
|
|
1818
2096
|
if (s2 === "captured" || s2 === "completed") return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
1819
2097
|
if (s2 === "authorized") return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
@@ -1892,7 +2170,7 @@ const PaymentDetailPage = () => {
|
|
|
1892
2170
|
Badge,
|
|
1893
2171
|
{
|
|
1894
2172
|
size: "2xsmall",
|
|
1895
|
-
className: `uppercase ${getStatusBadgeClass$
|
|
2173
|
+
className: `uppercase ${getStatusBadgeClass$2(displayStatus)}`,
|
|
1896
2174
|
children: displayStatus !== "—" ? displayStatus.replace(/_/g, " ") : "—"
|
|
1897
2175
|
}
|
|
1898
2176
|
) })
|
|
@@ -1928,11 +2206,11 @@ const PaymentDetailPage = () => {
|
|
|
1928
2206
|
] }) : null
|
|
1929
2207
|
] }) });
|
|
1930
2208
|
};
|
|
1931
|
-
const config$
|
|
2209
|
+
const config$2 = defineRouteConfig({
|
|
1932
2210
|
label: "Payment details",
|
|
1933
2211
|
icon: CreditCard
|
|
1934
2212
|
});
|
|
1935
|
-
const getStatusBadgeClass$
|
|
2213
|
+
const getStatusBadgeClass$1 = (status) => {
|
|
1936
2214
|
const s2 = status.toLowerCase();
|
|
1937
2215
|
if (s2 === "captured" || s2 === "completed") return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
1938
2216
|
if (s2 === "authorized") return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
@@ -1983,424 +2261,146 @@ const RefundDetailPage = () => {
|
|
|
1983
2261
|
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle font-mono", children: id ?? "—" })
|
|
1984
2262
|
] }) }),
|
|
1985
2263
|
error ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-strong p-6 text-center", children: [
|
|
1986
|
-
/* @__PURE__ */ jsx(Text, { weight: "plus", className: "text-ui-fg-error", children: error }),
|
|
1987
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", className: "mt-4", onClick: () => navigate("/refunds"), children: "Back to list" })
|
|
1988
|
-
] }) : 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: [
|
|
1989
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
1990
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg mb-4", children: "Refund summary" }),
|
|
1991
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
1992
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
1993
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Refund ID" }),
|
|
1994
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block font-mono text-sm", children: detail.refund.id })
|
|
1995
|
-
] }),
|
|
1996
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
1997
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Amount" }),
|
|
1998
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.refund.amount) })
|
|
1999
|
-
] }),
|
|
2000
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2001
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Note" }),
|
|
2002
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.refund.note ?? "—" })
|
|
2003
|
-
] }),
|
|
2004
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2005
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Created at" }),
|
|
2006
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: new Date(detail.refund.created_at).toLocaleDateString("en-US", {
|
|
2007
|
-
year: "numeric",
|
|
2008
|
-
month: "short",
|
|
2009
|
-
day: "numeric",
|
|
2010
|
-
hour: "numeric",
|
|
2011
|
-
minute: "2-digit",
|
|
2012
|
-
hour12: true
|
|
2013
|
-
}) })
|
|
2014
|
-
] }),
|
|
2015
|
-
detail.refund.created_by ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2016
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Created by" }),
|
|
2017
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block font-mono text-sm", children: detail.refund.created_by })
|
|
2018
|
-
] }) : null
|
|
2019
|
-
] })
|
|
2020
|
-
] }),
|
|
2021
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2022
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg mb-4", children: "Payment summary" }),
|
|
2023
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
2024
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2025
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Payment amount" }),
|
|
2026
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.payment.payment_amount) })
|
|
2027
|
-
] }),
|
|
2028
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2029
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Captured amount" }),
|
|
2030
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.payment.captured_amount) })
|
|
2031
|
-
] }),
|
|
2032
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2033
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Refunded amount" }),
|
|
2034
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.payment.refunded_amount) })
|
|
2035
|
-
] }),
|
|
2036
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2037
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Provider" }),
|
|
2038
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.payment.provider_id || "—" })
|
|
2039
|
-
] }),
|
|
2040
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2041
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Status" }),
|
|
2042
|
-
/* @__PURE__ */ jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsx(
|
|
2043
|
-
Badge,
|
|
2044
|
-
{
|
|
2045
|
-
size: "2xsmall",
|
|
2046
|
-
className: `uppercase ${getStatusBadgeClass$2(paymentStatus)}`,
|
|
2047
|
-
children: paymentStatus !== "—" ? paymentStatus.replace(/_/g, " ") : "—"
|
|
2048
|
-
}
|
|
2049
|
-
) })
|
|
2050
|
-
] }),
|
|
2051
|
-
detail.computed ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2052
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2053
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Full refund" }),
|
|
2054
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.computed.is_full_refund ? "Yes" : "No" })
|
|
2055
|
-
] }),
|
|
2056
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2057
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Remaining refundable" }),
|
|
2058
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.computed.remaining_refundable_amount) })
|
|
2059
|
-
] }),
|
|
2060
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2061
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Refund %" }),
|
|
2062
|
-
/* @__PURE__ */ jsxs(Text, { className: "mt-1 block", children: [
|
|
2063
|
-
detail.computed.refund_percentage.toFixed(1),
|
|
2064
|
-
"%"
|
|
2065
|
-
] })
|
|
2066
|
-
] })
|
|
2067
|
-
] }) : null
|
|
2068
|
-
] })
|
|
2069
|
-
] }),
|
|
2070
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2071
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg mb-4", children: "Order summary" }),
|
|
2072
|
-
detail.order ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
2073
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2074
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Order" }),
|
|
2075
|
-
/* @__PURE__ */ jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsx(
|
|
2076
|
-
Button,
|
|
2077
|
-
{
|
|
2078
|
-
variant: "transparent",
|
|
2079
|
-
size: "small",
|
|
2080
|
-
onClick: () => navigate(`/orders/${detail.order.order_id}`),
|
|
2081
|
-
children: detail.order.order_number ?? detail.order.order_id
|
|
2082
|
-
}
|
|
2083
|
-
) })
|
|
2084
|
-
] }),
|
|
2085
|
-
detail.order.total != null ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2086
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Total" }),
|
|
2087
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.order.total) })
|
|
2088
|
-
] }) : null,
|
|
2089
|
-
detail.order.customer_id ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2090
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Customer ID" }),
|
|
2091
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block font-mono text-sm", children: detail.order.customer_id })
|
|
2092
|
-
] }) : null,
|
|
2093
|
-
detail.order.region ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2094
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Region" }),
|
|
2095
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.order.region })
|
|
2096
|
-
] }) : null,
|
|
2097
|
-
detail.order.fulfillment_status ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2098
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Fulfillment status" }),
|
|
2099
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.order.fulfillment_status })
|
|
2100
|
-
] }) : null
|
|
2101
|
-
] }) : /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "No order linked to this refund." })
|
|
2102
|
-
] }),
|
|
2103
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2104
|
-
/* @__PURE__ */ jsxs(
|
|
2105
|
-
"button",
|
|
2106
|
-
{
|
|
2107
|
-
type: "button",
|
|
2108
|
-
className: "flex w-full items-center justify-between text-left",
|
|
2109
|
-
onClick: () => setGatewayExpanded((prev) => !prev),
|
|
2110
|
-
"aria-expanded": gatewayExpanded,
|
|
2111
|
-
"aria-label": gatewayExpanded ? "Collapse gateway data" : "Expand gateway data",
|
|
2112
|
-
children: [
|
|
2113
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg", children: "Gateway data" }),
|
|
2114
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: gatewayExpanded ? "Collapse" : "Expand" })
|
|
2115
|
-
]
|
|
2116
|
-
}
|
|
2117
|
-
),
|
|
2118
|
-
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." }) })
|
|
2119
|
-
] })
|
|
2120
|
-
] }) : null
|
|
2121
|
-
] }) });
|
|
2122
|
-
};
|
|
2123
|
-
const config$2 = defineRouteConfig({
|
|
2124
|
-
label: "Refund details",
|
|
2125
|
-
icon: Receipt
|
|
2126
|
-
});
|
|
2127
|
-
const getStatusBadgeClass$1 = (status) => {
|
|
2128
|
-
const statusLower = status.toLowerCase();
|
|
2129
|
-
if (statusLower === "requested") {
|
|
2130
|
-
return "bg-ui-tag-orange-bg text-ui-tag-orange-text";
|
|
2131
|
-
}
|
|
2132
|
-
if (statusLower === "approved") {
|
|
2133
|
-
return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
2134
|
-
}
|
|
2135
|
-
if (statusLower === "rejected") {
|
|
2136
|
-
return "bg-ui-tag-red-bg text-ui-tag-red-text";
|
|
2137
|
-
}
|
|
2138
|
-
if (statusLower === "received") {
|
|
2139
|
-
return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
2140
|
-
}
|
|
2141
|
-
if (statusLower === "refunded") {
|
|
2142
|
-
return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
2143
|
-
}
|
|
2144
|
-
if (statusLower === "completed") {
|
|
2145
|
-
return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
2146
|
-
}
|
|
2147
|
-
if (statusLower === "cancelled") {
|
|
2148
|
-
return "bg-ui-tag-grey-bg text-ui-tag-grey-text";
|
|
2149
|
-
}
|
|
2150
|
-
return "bg-ui-tag-purple-bg text-ui-tag-purple-text";
|
|
2151
|
-
};
|
|
2152
|
-
const ReturnDetailPage = () => {
|
|
2153
|
-
var _a, _b;
|
|
2154
|
-
const navigate = useNavigate();
|
|
2155
|
-
const { id } = useParams();
|
|
2156
|
-
const [returnOrder, setReturnOrder] = useState(null);
|
|
2157
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
2158
|
-
const [isRejecting, setIsRejecting] = useState(false);
|
|
2159
|
-
const [error, setError] = useState(null);
|
|
2160
|
-
const [updateError, setUpdateError] = useState(null);
|
|
2161
|
-
const [updateSuccess, setUpdateSuccess] = useState(false);
|
|
2162
|
-
useEffect(() => {
|
|
2163
|
-
if (!id) {
|
|
2164
|
-
navigate("/returns");
|
|
2165
|
-
return;
|
|
2166
|
-
}
|
|
2167
|
-
const loadReturn = async () => {
|
|
2168
|
-
try {
|
|
2169
|
-
setIsLoading(true);
|
|
2170
|
-
setError(null);
|
|
2171
|
-
const response = await fetch(`/admin/returns/${id}`, {
|
|
2172
|
-
credentials: "include"
|
|
2173
|
-
});
|
|
2174
|
-
if (!response.ok) {
|
|
2175
|
-
const message = await response.text();
|
|
2176
|
-
throw new Error(message || "Unable to load return order");
|
|
2177
|
-
}
|
|
2178
|
-
const payload = await response.json();
|
|
2179
|
-
setReturnOrder(payload.return);
|
|
2180
|
-
} catch (loadError) {
|
|
2181
|
-
const message = loadError instanceof Error ? loadError.message : "Unable to load return order";
|
|
2182
|
-
setError(message);
|
|
2183
|
-
} finally {
|
|
2184
|
-
setIsLoading(false);
|
|
2185
|
-
}
|
|
2186
|
-
};
|
|
2187
|
-
void loadReturn();
|
|
2188
|
-
}, [id, navigate]);
|
|
2189
|
-
const handleReject = async () => {
|
|
2190
|
-
if (!id) {
|
|
2191
|
-
return;
|
|
2192
|
-
}
|
|
2193
|
-
try {
|
|
2194
|
-
setIsRejecting(true);
|
|
2195
|
-
setUpdateError(null);
|
|
2196
|
-
setUpdateSuccess(false);
|
|
2197
|
-
const response = await fetch(`/admin/returns/${id}/reject`, {
|
|
2198
|
-
method: "POST",
|
|
2199
|
-
headers: {
|
|
2200
|
-
"Content-Type": "application/json"
|
|
2201
|
-
},
|
|
2202
|
-
credentials: "include",
|
|
2203
|
-
body: JSON.stringify({ reason: "Rejected by admin" })
|
|
2204
|
-
});
|
|
2205
|
-
if (!response.ok) {
|
|
2206
|
-
const message = await response.text();
|
|
2207
|
-
throw new Error(message || "Unable to reject return");
|
|
2208
|
-
}
|
|
2209
|
-
const payload = await response.json();
|
|
2210
|
-
setReturnOrder(payload.return);
|
|
2211
|
-
setUpdateSuccess(true);
|
|
2212
|
-
setTimeout(() => setUpdateSuccess(false), 3e3);
|
|
2213
|
-
const detailResponse = await fetch(`/admin/returns/${id}`, {
|
|
2214
|
-
credentials: "include"
|
|
2215
|
-
});
|
|
2216
|
-
if (detailResponse.ok) {
|
|
2217
|
-
const detailPayload = await detailResponse.json();
|
|
2218
|
-
setReturnOrder(detailPayload.return);
|
|
2219
|
-
}
|
|
2220
|
-
} catch (updateErr) {
|
|
2221
|
-
const message = updateErr instanceof Error ? updateErr.message : "Unable to reject return";
|
|
2222
|
-
setUpdateError(message);
|
|
2223
|
-
} finally {
|
|
2224
|
-
setIsRejecting(false);
|
|
2225
|
-
}
|
|
2226
|
-
};
|
|
2227
|
-
if (isLoading) {
|
|
2228
|
-
return /* @__PURE__ */ jsx("div", { className: "w-full p-6", children: /* @__PURE__ */ jsx(Container, { className: "mx-auto flex w-full max-w-5xl flex-col gap-6 p-6", children: /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading return order..." }) }) }) });
|
|
2229
|
-
}
|
|
2230
|
-
if (error || !returnOrder) {
|
|
2231
|
-
return /* @__PURE__ */ jsx("div", { className: "w-full p-6", children: /* @__PURE__ */ jsx(Container, { className: "mx-auto flex w-full max-w-5xl flex-col gap-6 p-6", children: /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-strong p-6 text-center", children: [
|
|
2232
|
-
/* @__PURE__ */ jsx(Text, { weight: "plus", className: "text-ui-fg-error", children: error || "Return order not found" }),
|
|
2233
|
-
/* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: () => navigate("/returns"), children: "Back to list" }) })
|
|
2234
|
-
] }) }) });
|
|
2235
|
-
}
|
|
2236
|
-
const statusHistory = ((_a = returnOrder.metadata) == null ? void 0 : _a.status_history) || [];
|
|
2237
|
-
return /* @__PURE__ */ jsx("div", { className: "w-full p-6", children: /* @__PURE__ */ jsxs(Container, { className: "mx-auto flex w-full max-w-5xl flex-col gap-6 p-6", children: [
|
|
2238
|
-
/* @__PURE__ */ jsxs("header", { className: "flex flex-col gap-3", children: [
|
|
2239
|
-
/* @__PURE__ */ jsxs(
|
|
2240
|
-
Button,
|
|
2241
|
-
{
|
|
2242
|
-
variant: "transparent",
|
|
2243
|
-
size: "small",
|
|
2244
|
-
onClick: () => navigate("/returns"),
|
|
2245
|
-
className: "w-fit",
|
|
2246
|
-
children: [
|
|
2247
|
-
/* @__PURE__ */ jsx(ArrowLeft, { className: "mr-2" }),
|
|
2248
|
-
"Back to list"
|
|
2249
|
-
]
|
|
2250
|
-
}
|
|
2251
|
-
),
|
|
2252
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 md:flex-row md:items-center md:justify-between", children: [
|
|
2253
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
2254
|
-
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "Return Order Details" }),
|
|
2255
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: returnOrder.id })
|
|
2256
|
-
] }),
|
|
2257
|
-
/* @__PURE__ */ jsx(
|
|
2258
|
-
Badge,
|
|
2259
|
-
{
|
|
2260
|
-
size: "small",
|
|
2261
|
-
className: `uppercase ${getStatusBadgeClass$1(returnOrder.status)}`,
|
|
2262
|
-
children: returnOrder.status.replace(/_/g, " ")
|
|
2263
|
-
}
|
|
2264
|
-
)
|
|
2265
|
-
] })
|
|
2266
|
-
] }),
|
|
2267
|
-
returnOrder.status === "requested" && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
2268
|
-
/* @__PURE__ */ jsx("div", { className: "flex gap-3", children: /* @__PURE__ */ jsx(
|
|
2269
|
-
Button,
|
|
2270
|
-
{
|
|
2271
|
-
variant: "danger",
|
|
2272
|
-
onClick: handleReject,
|
|
2273
|
-
disabled: isRejecting,
|
|
2274
|
-
isLoading: isRejecting,
|
|
2275
|
-
children: "Reject (Cancel) Return"
|
|
2276
|
-
}
|
|
2277
|
-
) }),
|
|
2278
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: 'Cancel this return request. Use "Mark as received" when items are received.' })
|
|
2279
|
-
] }),
|
|
2280
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-base p-6", children: [
|
|
2281
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "mb-4 text-lg", children: "Return Information" }),
|
|
2282
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
2283
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2284
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Return ID" }),
|
|
2285
|
-
/* @__PURE__ */ jsx(Text, { className: "font-medium", children: returnOrder.id })
|
|
2286
|
-
] }),
|
|
2287
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
2288
|
-
Button,
|
|
2289
|
-
{
|
|
2290
|
-
variant: "secondary",
|
|
2291
|
-
onClick: () => {
|
|
2292
|
-
window.open(
|
|
2293
|
-
`/app/orders/${returnOrder.order_id}`,
|
|
2294
|
-
"_blank"
|
|
2295
|
-
);
|
|
2296
|
-
},
|
|
2297
|
-
children: "View order"
|
|
2298
|
-
}
|
|
2299
|
-
) })
|
|
2300
|
-
] })
|
|
2301
|
-
] }),
|
|
2302
|
-
/* @__PURE__ */ jsxs("div", { className: "grid gap-6 md:grid-cols-2", children: [
|
|
2303
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-base p-6", children: [
|
|
2304
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "mb-4 text-lg", children: "Return Details" }),
|
|
2305
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
2264
|
+
/* @__PURE__ */ jsx(Text, { weight: "plus", className: "text-ui-fg-error", children: error }),
|
|
2265
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", className: "mt-4", onClick: () => navigate("/refunds"), children: "Back to list" })
|
|
2266
|
+
] }) : 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: [
|
|
2267
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2268
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg mb-4", children: "Refund summary" }),
|
|
2269
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
2306
2270
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
2307
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-
|
|
2308
|
-
/* @__PURE__ */ jsx(Text, { className: "font-
|
|
2271
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Refund ID" }),
|
|
2272
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block font-mono text-sm", children: detail.refund.id })
|
|
2309
2273
|
] }),
|
|
2310
2274
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
2311
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-
|
|
2312
|
-
/* @__PURE__ */ jsx(Text, { className: "
|
|
2313
|
-
] }),
|
|
2314
|
-
returnOrder.reason && /* @__PURE__ */ jsxs("div", { children: [
|
|
2315
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Reason" }),
|
|
2316
|
-
/* @__PURE__ */ jsx(Text, { className: "font-medium", children: returnOrder.reason })
|
|
2317
|
-
] }),
|
|
2318
|
-
returnOrder.note && /* @__PURE__ */ jsxs("div", { children: [
|
|
2319
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Note" }),
|
|
2320
|
-
/* @__PURE__ */ jsx(Text, { className: "font-medium", children: returnOrder.note })
|
|
2275
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Amount" }),
|
|
2276
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.refund.amount) })
|
|
2321
2277
|
] }),
|
|
2322
2278
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
2323
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-
|
|
2324
|
-
/* @__PURE__ */ jsx(Text, { className: "
|
|
2279
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Note" }),
|
|
2280
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.refund.note ?? "—" })
|
|
2325
2281
|
] }),
|
|
2326
2282
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
2327
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-
|
|
2328
|
-
/* @__PURE__ */ jsx(Text, { className: "
|
|
2329
|
-
|
|
2283
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Created at" }),
|
|
2284
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: new Date(detail.refund.created_at).toLocaleDateString("en-US", {
|
|
2285
|
+
year: "numeric",
|
|
2286
|
+
month: "short",
|
|
2287
|
+
day: "numeric",
|
|
2288
|
+
hour: "numeric",
|
|
2289
|
+
minute: "2-digit",
|
|
2290
|
+
hour12: true
|
|
2291
|
+
}) })
|
|
2292
|
+
] }),
|
|
2293
|
+
detail.refund.created_by ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2294
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Created by" }),
|
|
2295
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block font-mono text-sm", children: detail.refund.created_by })
|
|
2296
|
+
] }) : null
|
|
2330
2297
|
] })
|
|
2331
2298
|
] }),
|
|
2332
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-
|
|
2333
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "mb-4
|
|
2334
|
-
|
|
2335
|
-
"div",
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2299
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2300
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg mb-4", children: "Payment summary" }),
|
|
2301
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
2302
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2303
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Payment amount" }),
|
|
2304
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.payment.payment_amount) })
|
|
2305
|
+
] }),
|
|
2306
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2307
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Captured amount" }),
|
|
2308
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.payment.captured_amount) })
|
|
2309
|
+
] }),
|
|
2310
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2311
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Refunded amount" }),
|
|
2312
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.payment.refunded_amount) })
|
|
2313
|
+
] }),
|
|
2314
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2315
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Provider" }),
|
|
2316
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.payment.provider_id || "—" })
|
|
2317
|
+
] }),
|
|
2318
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2319
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Status" }),
|
|
2320
|
+
/* @__PURE__ */ jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsx(
|
|
2321
|
+
Badge,
|
|
2322
|
+
{
|
|
2323
|
+
size: "2xsmall",
|
|
2324
|
+
className: `uppercase ${getStatusBadgeClass$1(paymentStatus)}`,
|
|
2325
|
+
children: paymentStatus !== "—" ? paymentStatus.replace(/_/g, " ") : "—"
|
|
2326
|
+
}
|
|
2327
|
+
) })
|
|
2328
|
+
] }),
|
|
2329
|
+
detail.computed ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2330
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2331
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Full refund" }),
|
|
2332
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.computed.is_full_refund ? "Yes" : "No" })
|
|
2333
|
+
] }),
|
|
2334
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2335
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Remaining refundable" }),
|
|
2336
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.computed.remaining_refundable_amount) })
|
|
2337
|
+
] }),
|
|
2338
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2339
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Refund %" }),
|
|
2340
|
+
/* @__PURE__ */ jsxs(Text, { className: "mt-1 block", children: [
|
|
2341
|
+
detail.computed.refund_percentage.toFixed(1),
|
|
2342
|
+
"%"
|
|
2351
2343
|
] })
|
|
2352
2344
|
] })
|
|
2353
|
-
}
|
|
2354
|
-
index
|
|
2355
|
-
)) }) : /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "No status history available" })
|
|
2356
|
-
] })
|
|
2357
|
-
] }),
|
|
2358
|
-
returnOrder.order && /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-base p-6", children: [
|
|
2359
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "mb-4 text-lg", children: "Related Order Information" }),
|
|
2360
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
2361
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2362
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Order ID" }),
|
|
2363
|
-
/* @__PURE__ */ jsx(Text, { className: "font-medium", children: returnOrder.order.id })
|
|
2364
|
-
] }),
|
|
2365
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2366
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Order Status" }),
|
|
2367
|
-
/* @__PURE__ */ jsx(Text, { className: "font-medium", children: returnOrder.order.status || "—" })
|
|
2368
|
-
] }),
|
|
2369
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2370
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Customer" }),
|
|
2371
|
-
/* @__PURE__ */ jsx(Text, { className: "font-medium", children: ((_b = returnOrder.order.customer) == null ? void 0 : _b.email) || returnOrder.order.email || "—" })
|
|
2372
|
-
] }),
|
|
2373
|
-
returnOrder.order.total && /* @__PURE__ */ jsxs("div", { children: [
|
|
2374
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Order Total" }),
|
|
2375
|
-
/* @__PURE__ */ jsxs(Text, { className: "font-medium", children: [
|
|
2376
|
-
returnOrder.order.currency_code || "$",
|
|
2377
|
-
(Number(returnOrder.order.total) / 100).toFixed(2)
|
|
2378
|
-
] })
|
|
2345
|
+
] }) : null
|
|
2379
2346
|
] })
|
|
2347
|
+
] }),
|
|
2348
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2349
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg mb-4", children: "Order summary" }),
|
|
2350
|
+
detail.order ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
2351
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2352
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Order" }),
|
|
2353
|
+
/* @__PURE__ */ jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsx(
|
|
2354
|
+
Button,
|
|
2355
|
+
{
|
|
2356
|
+
variant: "transparent",
|
|
2357
|
+
size: "small",
|
|
2358
|
+
onClick: () => navigate(`/orders/${detail.order.order_id}`),
|
|
2359
|
+
children: detail.order.order_number ?? detail.order.order_id
|
|
2360
|
+
}
|
|
2361
|
+
) })
|
|
2362
|
+
] }),
|
|
2363
|
+
detail.order.total != null ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2364
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Total" }),
|
|
2365
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.order.total) })
|
|
2366
|
+
] }) : null,
|
|
2367
|
+
detail.order.customer_id ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2368
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Customer ID" }),
|
|
2369
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block font-mono text-sm", children: detail.order.customer_id })
|
|
2370
|
+
] }) : null,
|
|
2371
|
+
detail.order.region ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2372
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Region" }),
|
|
2373
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.order.region })
|
|
2374
|
+
] }) : null,
|
|
2375
|
+
detail.order.fulfillment_status ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2376
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Fulfillment status" }),
|
|
2377
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.order.fulfillment_status })
|
|
2378
|
+
] }) : null
|
|
2379
|
+
] }) : /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "No order linked to this refund." })
|
|
2380
|
+
] }),
|
|
2381
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2382
|
+
/* @__PURE__ */ jsxs(
|
|
2383
|
+
"button",
|
|
2384
|
+
{
|
|
2385
|
+
type: "button",
|
|
2386
|
+
className: "flex w-full items-center justify-between text-left",
|
|
2387
|
+
onClick: () => setGatewayExpanded((prev) => !prev),
|
|
2388
|
+
"aria-expanded": gatewayExpanded,
|
|
2389
|
+
"aria-label": gatewayExpanded ? "Collapse gateway data" : "Expand gateway data",
|
|
2390
|
+
children: [
|
|
2391
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg", children: "Gateway data" }),
|
|
2392
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: gatewayExpanded ? "Collapse" : "Expand" })
|
|
2393
|
+
]
|
|
2394
|
+
}
|
|
2395
|
+
),
|
|
2396
|
+
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." }) })
|
|
2380
2397
|
] })
|
|
2381
|
-
] })
|
|
2382
|
-
returnOrder.return_items && returnOrder.return_items.length > 0 && /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-base bg-ui-bg-base p-6", children: [
|
|
2383
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "mb-4 text-lg", children: "Return Items" }),
|
|
2384
|
-
/* @__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: [
|
|
2385
|
-
/* @__PURE__ */ jsx("thead", { className: "bg-ui-bg-subtle", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
2386
|
-
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Item ID" }),
|
|
2387
|
-
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Quantity" }),
|
|
2388
|
-
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Reason" })
|
|
2389
|
-
] }) }),
|
|
2390
|
-
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-ui-border-subtle", children: returnOrder.return_items.map((item, index) => /* @__PURE__ */ jsxs("tr", { children: [
|
|
2391
|
-
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 font-medium text-ui-fg-base", children: item.id }),
|
|
2392
|
-
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: item.quantity }),
|
|
2393
|
-
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: item.reason || "—" })
|
|
2394
|
-
] }, item.id || index)) })
|
|
2395
|
-
] }) })
|
|
2396
|
-
] }),
|
|
2397
|
-
updateError && /* @__PURE__ */ jsx("div", { className: "rounded-lg border border-ui-border-error bg-ui-bg-error-subtle p-4", children: /* @__PURE__ */ jsx(Text, { className: "text-ui-fg-error", children: updateError }) }),
|
|
2398
|
-
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" }) })
|
|
2398
|
+
] }) : null
|
|
2399
2399
|
] }) });
|
|
2400
2400
|
};
|
|
2401
2401
|
const config$1 = defineRouteConfig({
|
|
2402
|
-
label: "
|
|
2403
|
-
icon:
|
|
2402
|
+
label: "Refund details",
|
|
2403
|
+
icon: Receipt
|
|
2404
2404
|
});
|
|
2405
2405
|
const getStatusBadgeClass = (status) => {
|
|
2406
2406
|
const statusLower = status.toLowerCase();
|
|
@@ -2694,6 +2694,10 @@ const widgetModule = { widgets: [
|
|
|
2694
2694
|
] };
|
|
2695
2695
|
const routeModule = {
|
|
2696
2696
|
routes: [
|
|
2697
|
+
{
|
|
2698
|
+
Component: ReturnsPage,
|
|
2699
|
+
path: "/returns"
|
|
2700
|
+
},
|
|
2697
2701
|
{
|
|
2698
2702
|
Component: PaymentsPage,
|
|
2699
2703
|
path: "/payments"
|
|
@@ -2702,14 +2706,14 @@ const routeModule = {
|
|
|
2702
2706
|
Component: RefundsPage,
|
|
2703
2707
|
path: "/refunds"
|
|
2704
2708
|
},
|
|
2705
|
-
{
|
|
2706
|
-
Component: ReturnsPage,
|
|
2707
|
-
path: "/returns"
|
|
2708
|
-
},
|
|
2709
2709
|
{
|
|
2710
2710
|
Component: SwapsPage,
|
|
2711
2711
|
path: "/swaps"
|
|
2712
2712
|
},
|
|
2713
|
+
{
|
|
2714
|
+
Component: ReturnDetailPage,
|
|
2715
|
+
path: "/returns/:id"
|
|
2716
|
+
},
|
|
2713
2717
|
{
|
|
2714
2718
|
Component: PaymentDetailPage,
|
|
2715
2719
|
path: "/payments/:id"
|
|
@@ -2718,10 +2722,6 @@ const routeModule = {
|
|
|
2718
2722
|
Component: RefundDetailPage,
|
|
2719
2723
|
path: "/refunds/:id"
|
|
2720
2724
|
},
|
|
2721
|
-
{
|
|
2722
|
-
Component: ReturnDetailPage,
|
|
2723
|
-
path: "/returns/:id"
|
|
2724
|
-
},
|
|
2725
2725
|
{
|
|
2726
2726
|
Component: SwapDetailPage,
|
|
2727
2727
|
path: "/swaps/:id"
|
|
@@ -2731,50 +2731,50 @@ const routeModule = {
|
|
|
2731
2731
|
const menuItemModule = {
|
|
2732
2732
|
menuItems: [
|
|
2733
2733
|
{
|
|
2734
|
-
label: config$
|
|
2735
|
-
icon: config$
|
|
2736
|
-
path: "/
|
|
2734
|
+
label: config$4.label,
|
|
2735
|
+
icon: config$4.icon,
|
|
2736
|
+
path: "/swaps",
|
|
2737
2737
|
nested: void 0
|
|
2738
2738
|
},
|
|
2739
2739
|
{
|
|
2740
2740
|
label: config$5.label,
|
|
2741
2741
|
icon: config$5.icon,
|
|
2742
|
-
path: "/
|
|
2742
|
+
path: "/refunds",
|
|
2743
2743
|
nested: void 0
|
|
2744
2744
|
},
|
|
2745
2745
|
{
|
|
2746
|
-
label: config$
|
|
2747
|
-
icon: config$
|
|
2748
|
-
path: "/
|
|
2746
|
+
label: config$7.label,
|
|
2747
|
+
icon: config$7.icon,
|
|
2748
|
+
path: "/returns",
|
|
2749
2749
|
nested: void 0
|
|
2750
2750
|
},
|
|
2751
2751
|
{
|
|
2752
|
-
label: config$
|
|
2753
|
-
icon: config$
|
|
2752
|
+
label: config$6.label,
|
|
2753
|
+
icon: config$6.icon,
|
|
2754
2754
|
path: "/payments",
|
|
2755
2755
|
nested: void 0
|
|
2756
2756
|
},
|
|
2757
2757
|
{
|
|
2758
|
-
label: config
|
|
2759
|
-
icon: config
|
|
2760
|
-
path: "/
|
|
2758
|
+
label: config.label,
|
|
2759
|
+
icon: config.icon,
|
|
2760
|
+
path: "/swaps/:id",
|
|
2761
2761
|
nested: void 0
|
|
2762
2762
|
},
|
|
2763
2763
|
{
|
|
2764
2764
|
label: config$1.label,
|
|
2765
2765
|
icon: config$1.icon,
|
|
2766
|
-
path: "/
|
|
2766
|
+
path: "/refunds/:id",
|
|
2767
2767
|
nested: void 0
|
|
2768
2768
|
},
|
|
2769
2769
|
{
|
|
2770
|
-
label: config.label,
|
|
2771
|
-
icon: config.icon,
|
|
2772
|
-
path: "/
|
|
2770
|
+
label: config$3.label,
|
|
2771
|
+
icon: config$3.icon,
|
|
2772
|
+
path: "/returns/:id",
|
|
2773
2773
|
nested: void 0
|
|
2774
2774
|
},
|
|
2775
2775
|
{
|
|
2776
|
-
label: config$
|
|
2777
|
-
icon: config$
|
|
2776
|
+
label: config$2.label,
|
|
2777
|
+
icon: config$2.icon,
|
|
2778
2778
|
path: "/payments/:id",
|
|
2779
2779
|
nested: void 0
|
|
2780
2780
|
}
|