@medusajs/dashboard 2.10.4-snapshot-20250922195925 → 2.10.4-snapshot-20250923121159
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.
- package/dist/{add-campaign-promotions-PLZXWFNV.mjs → add-campaign-promotions-JOVLXLS4.mjs} +3 -3
- package/dist/{api-key-management-detail-ZQFNZNWW.mjs → api-key-management-detail-I7T67TXF.mjs} +2 -3
- package/dist/{api-key-management-sales-channels-WL5L5XWM.mjs → api-key-management-sales-channels-6GN6RVZ2.mjs} +1 -1
- package/dist/app.css +0 -3
- package/dist/app.js +3320 -4024
- package/dist/app.mjs +3 -4
- package/dist/{campaign-detail-VTCCVWKS.mjs → campaign-detail-NRZHGINV.mjs} +4 -5
- package/dist/{categories-metadata-FTFYPASQ.mjs → categories-metadata-GXWJ3HOG.mjs} +1 -2
- package/dist/{category-detail-QHU2CLYA.mjs → category-detail-ENUI5EFL.mjs} +2 -3
- package/dist/{category-products-YGTL7GXQ.mjs → category-products-ZG5QDWSW.mjs} +2 -3
- package/dist/{chunk-JO6QASTJ.mjs → chunk-37UXEJF2.mjs} +1 -1
- package/dist/{chunk-BM5ZIV5V.mjs → chunk-5WKYR6PY.mjs} +1 -1
- package/dist/{chunk-VE7JFMAN.mjs → chunk-6AGMMT5H.mjs} +2 -2
- package/dist/{chunk-XTNS2NRD.mjs → chunk-BHZAQZYP.mjs} +1 -1
- package/dist/{chunk-6V6KATTW.mjs → chunk-JHXKKOHO.mjs} +10 -33
- package/dist/{chunk-FTVAORQM.mjs → chunk-JIQQKKLO.mjs} +1 -1
- package/dist/{chunk-5CE3JPWD.mjs → chunk-JMQ6V54O.mjs} +1 -1
- package/dist/{chunk-CU5EFQSB.mjs → chunk-NRBOPOMS.mjs} +1 -1
- package/dist/{chunk-BSBCIU6C.mjs → chunk-OGHQ6VJI.mjs} +5 -0
- package/dist/{chunk-K3OMOMRB.mjs → chunk-OKMF4YI7.mjs} +0 -25
- package/dist/{chunk-PHXKD2LR.mjs → chunk-OLUNPPBR.mjs} +1 -1
- package/dist/{chunk-WYDDFRYM.mjs → chunk-RVOPC44F.mjs} +103 -135
- package/dist/{chunk-YPDTZXV6.mjs → chunk-Y4YXZY7R.mjs} +1 -1
- package/dist/{chunk-UNM3LPTG.mjs → chunk-YM4QJC6Y.mjs} +24 -11
- package/dist/{chunk-PPI7PTY6.mjs → chunk-ZJA7VBUR.mjs} +6 -33
- package/dist/{collection-add-products-OJ2EZLC7.mjs → collection-add-products-2ISNNIHD.mjs} +2 -3
- package/dist/{collection-detail-RMZK523E.mjs → collection-detail-OSX6NHNQ.mjs} +2 -3
- package/dist/{collection-list-BJ3VNZAA.mjs → collection-list-MPIYSHQJ.mjs} +3 -4
- package/dist/{collection-metadata-R3DI65D3.mjs → collection-metadata-EOFYXEQI.mjs} +1 -2
- package/dist/{customer-detail-G7G6PYOO.mjs → customer-detail-FCNRRZSW.mjs} +1 -2
- package/dist/{customer-group-detail-XQ32DPQ3.mjs → customer-group-detail-QI3QLJJL.mjs} +1 -2
- package/dist/{customer-group-list-CARES5CM.mjs → customer-group-list-D26UKQMR.mjs} +2 -3
- package/dist/{customers-add-customer-group-NLPVKARS.mjs → customers-add-customer-group-5TFTVDB6.mjs} +1 -2
- package/dist/{edit-rules-JRLCVE26.mjs → edit-rules-63NG4QVR.mjs} +1 -2
- package/dist/{inventory-create-ZC6HV2FY.mjs → inventory-create-RIVJFJJQ.mjs} +1 -2
- package/dist/{inventory-detail-WVI4FTTH.mjs → inventory-detail-QHL7TJFZ.mjs} +2 -3
- package/dist/{inventory-metadata-BLIJBNQS.mjs → inventory-metadata-FH4CHJBA.mjs} +1 -2
- package/dist/{inventory-stock-ZCTXWRK6.mjs → inventory-stock-D6E4LQRK.mjs} +1 -2
- package/dist/{location-detail-GV3POY4C.mjs → location-detail-Z6ZDX6RY.mjs} +1 -2
- package/dist/{location-fulfillment-providers-INUQXJYU.mjs → location-fulfillment-providers-45VXZMZI.mjs} +2 -3
- package/dist/location-list-62KBWY4T.mjs +316 -0
- package/dist/{location-sales-channels-2BOIPBBG.mjs → location-sales-channels-O5XLIPAR.mjs} +1 -1
- package/dist/{location-service-zone-shipping-option-create-6KO3QDMQ.mjs → location-service-zone-shipping-option-create-NO3665DC.mjs} +1 -2
- package/dist/{login-57FIKGXA.mjs → login-DSPNELTI.mjs} +1 -2
- package/dist/{order-create-claim-LXKBCAWN.mjs → order-create-claim-V63BWLB5.mjs} +1 -2
- package/dist/{order-create-edit-264PTIEI.mjs → order-create-edit-NPF4UZ4D.mjs} +1 -2
- package/dist/{order-create-exchange-ZMUVPYM3.mjs → order-create-exchange-RHIPPSKU.mjs} +1 -2
- package/dist/{order-create-fulfillment-LE6O3SA5.mjs → order-create-fulfillment-4SSUHQ75.mjs} +1 -2
- package/dist/{order-create-refund-B7BO2EJL.mjs → order-create-refund-QVQC5ZP5.mjs} +1 -2
- package/dist/{order-create-shipment-UOPCS5N7.mjs → order-create-shipment-TJAARKWA.mjs} +1 -2
- package/dist/{order-detail-SG7AXBRS.mjs → order-detail-2MIN6B2I.mjs} +1 -2
- package/dist/{order-edit-billing-address-RPPJ4Z36.mjs → order-edit-billing-address-QP2I5F3E.mjs} +1 -2
- package/dist/{order-edit-email-A7D5HTU6.mjs → order-edit-email-7WT7XTHB.mjs} +1 -2
- package/dist/{order-edit-shipping-address-LXKC5CJE.mjs → order-edit-shipping-address-3QFMQP4I.mjs} +1 -2
- package/dist/{order-list-ZCMNSZYB.mjs → order-list-73DBATIK.mjs} +2 -2
- package/dist/{order-metadata-KS47UOEE.mjs → order-metadata-YJS26DHK.mjs} +1 -2
- package/dist/{order-receive-return-PDU2YVLT.mjs → order-receive-return-PZMMMUB2.mjs} +1 -2
- package/dist/{order-request-transfer-WMQKDLDF.mjs → order-request-transfer-QBIZD36E.mjs} +1 -2
- package/dist/{price-list-create-QZSB4W5Z.mjs → price-list-create-RXDH5CXF.mjs} +2 -3
- package/dist/{price-list-detail-2FMINPFT.mjs → price-list-detail-PKIKOJ4H.mjs} +2 -3
- package/dist/{price-list-prices-add-WYK2QBAI.mjs → price-list-prices-add-2CDPUSYA.mjs} +2 -3
- package/dist/{product-attributes-KDXI2RNP.mjs → product-attributes-FQDJCNUB.mjs} +4 -5
- package/dist/{product-create-TVYPK4VC.mjs → product-create-W37RQLON.mjs} +5 -6
- package/dist/{product-create-variant-6YWLDA2X.mjs → product-create-variant-KJKQ6ROY.mjs} +1 -2
- package/dist/{product-detail-RFKXMYE5.mjs → product-detail-TANIKAEK.mjs} +5 -6
- package/dist/{product-edit-5FNY7HG4.mjs → product-edit-DO76GHBI.mjs} +4 -5
- package/dist/{product-export-BEAUMFAZ.mjs → product-export-XERWEI5H.mjs} +2 -3
- package/dist/{product-import-SOX4UJPM.mjs → product-import-AGFJMSVK.mjs} +1 -2
- package/dist/{product-list-ZVXATJRE.mjs → product-list-KJ3HXPLB.mjs} +4 -5
- package/dist/{product-media-JPU23SPH.mjs → product-media-VG4YM2W6.mjs} +2 -2
- package/dist/{product-metadata-QRRCHZZB.mjs → product-metadata-NZ3HKO67.mjs} +1 -2
- package/dist/{product-organization-QTWB7VMB.mjs → product-organization-OOVUGXNP.mjs} +4 -5
- package/dist/{product-sales-channels-UGPAXFAV.mjs → product-sales-channels-QEJRSCAU.mjs} +1 -1
- package/dist/{product-shipping-profile-Q6UX6ZNJ.mjs → product-shipping-profile-FFMKOF6B.mjs} +4 -5
- package/dist/{product-stock-TSAIHVY6.mjs → product-stock-SUVEQZML.mjs} +1 -2
- package/dist/{product-tag-create-5NZJS2D2.mjs → product-tag-create-T6HVAQKN.mjs} +1 -2
- package/dist/{product-tag-detail-3XHUROBO.mjs → product-tag-detail-HOWUZC3P.mjs} +5 -6
- package/dist/{product-tag-edit-YYOOHKGG.mjs → product-tag-edit-WWQDNDRC.mjs} +1 -2
- package/dist/{product-tag-list-5XTTMNOA.mjs → product-tag-list-FAKSLONF.mjs} +5 -6
- package/dist/{product-tag-metadata-YAD3MPWF.mjs → product-tag-metadata-6B56VEZU.mjs} +1 -2
- package/dist/{product-type-detail-MNTAHQKJ.mjs → product-type-detail-KN64HYUV.mjs} +2 -3
- package/dist/{product-type-metadata-HWR3WBGT.mjs → product-type-metadata-F3FTI6OG.mjs} +1 -2
- package/dist/{product-variant-detail-DKFAG3KO.mjs → product-variant-detail-OUHBUY4J.mjs} +1 -2
- package/dist/{product-variant-edit-EZENYVAN.mjs → product-variant-edit-NBYHDUJ5.mjs} +1 -2
- package/dist/{product-variant-metadata-S7QENSUG.mjs → product-variant-metadata-XDVLJYGQ.mjs} +1 -2
- package/dist/{promotion-create-O3KUSPIU.mjs → promotion-create-UUOG52D5.mjs} +1 -2
- package/dist/{promotion-detail-5DU6ULJG.mjs → promotion-detail-GONXLJZ2.mjs} +113 -65
- package/dist/{promotion-list-Q2FOGORE.mjs → promotion-list-NNEMVJ6I.mjs} +3 -3
- package/dist/{region-metadata-G3JH5ZN6.mjs → region-metadata-IQVB4ERU.mjs} +1 -2
- package/dist/{reservation-detail-PJXS67UM.mjs → reservation-detail-RTGHD35L.mjs} +1 -2
- package/dist/{reservation-metadata-UCKQB66O.mjs → reservation-metadata-WKJXBRLQ.mjs} +1 -2
- package/dist/{reset-password-5KIEBJHN.mjs → reset-password-ANJHGYUE.mjs} +1 -1
- package/dist/{return-reason-list-OGFYWMC5.mjs → return-reason-list-MOP7YWMZ.mjs} +2 -2
- package/dist/{sales-channel-add-products-CSMNFGHD.mjs → sales-channel-add-products-OKVZJ6FI.mjs} +2 -3
- package/dist/{sales-channel-detail-ZSA3HNWW.mjs → sales-channel-detail-WESBK6Q7.mjs} +2 -3
- package/dist/{sales-channel-list-X5ADP34V.mjs → sales-channel-list-LKVHXUXW.mjs} +2 -3
- package/dist/{sales-channel-metadata-ABWIDI3B.mjs → sales-channel-metadata-2OQAHYB4.mjs} +1 -2
- package/dist/{shipping-option-type-create-Q2X5OMJS.mjs → shipping-option-type-create-3CGPGDYJ.mjs} +1 -2
- package/dist/{shipping-option-type-detail-VT3Y5QQ4.mjs → shipping-option-type-detail-S23H2OGW.mjs} +2 -3
- package/dist/{shipping-option-type-edit-IA3EER2N.mjs → shipping-option-type-edit-IHE7XM6M.mjs} +1 -2
- package/dist/{shipping-option-type-list-JZPKAL3H.mjs → shipping-option-type-list-47GRJ6EC.mjs} +2 -3
- package/dist/{shipping-profile-metadata-EYXBWBF2.mjs → shipping-profile-metadata-OXWOXAAR.mjs} +1 -2
- package/dist/{store-detail-LI72QMUZ.mjs → store-detail-4K7TW2TP.mjs} +1 -2
- package/dist/{store-metadata-ZITLAS5H.mjs → store-metadata-JP2CI7EF.mjs} +1 -2
- package/dist/{tax-region-create-IU2R5VIY.mjs → tax-region-create-IWM4755I.mjs} +2 -3
- package/dist/{tax-region-detail-6FHD35LB.mjs → tax-region-detail-V2F2DONN.mjs} +1 -2
- package/dist/{tax-region-edit-O2WJXYIE.mjs → tax-region-edit-CJPMYTBF.mjs} +1 -2
- package/dist/{tax-region-province-detail-YDBU4CUU.mjs → tax-region-province-detail-4PUQ5ADW.mjs} +1 -2
- package/dist/{tax-region-tax-override-create-EF3LLZWM.mjs → tax-region-tax-override-create-3SCIOK4P.mjs} +5 -6
- package/dist/{tax-region-tax-override-edit-2DG3J6CO.mjs → tax-region-tax-override-edit-P3QJKET3.mjs} +5 -6
- package/dist/{user-list-3YFYZFSK.mjs → user-list-MKJLB5CQ.mjs} +1 -1
- package/dist/{user-metadata-QUIFIM5G.mjs → user-metadata-ZURLDLGC.mjs} +1 -2
- package/dist/{workflow-execution-detail-PVSQ2VGE.mjs → workflow-execution-detail-4R6AFFHV.mjs} +1 -2
- package/package.json +9 -9
- package/src/components/data-table/data-table.tsx +64 -46
- package/src/components/layout/settings-layout/settings-layout.tsx +0 -4
- package/src/dashboard-app/routes/get-route.map.tsx +0 -36
- package/src/hooks/api/refund-reasons.tsx +9 -113
- package/src/hooks/table/columns/index.ts +0 -1
- package/src/hooks/table/query/index.ts +0 -1
- package/src/i18n/translations/$schema.json +19 -112
- package/src/i18n/translations/en.json +6 -33
- package/src/routes/locations/location-list/index.ts +0 -1
- package/src/routes/locations/location-list/location-list.tsx +51 -19
- package/src/routes/locations/location-list/use-location-list-table-columns.tsx +185 -0
- package/src/routes/locations/location-list/use-location-list-table-query.tsx +22 -0
- package/dist/chunk-BKJC5BGQ.mjs +0 -53
- package/dist/chunk-YZJ3W776.mjs +0 -87
- package/dist/location-list-BKK2PAKF.mjs +0 -297
- package/dist/refund-reason-create-NSZFGXWI.mjs +0 -158
- package/dist/refund-reason-edit-RKUSPQCL.mjs +0 -144
- package/dist/refund-reason-list-2F5PFERT.mjs +0 -273
- package/src/hooks/table/columns/use-refund-reason-table-columns.tsx +0 -28
- package/src/hooks/table/query/use-refund-reason-table-query.tsx +0 -32
- package/src/routes/locations/location-list/components/location-list-header/index.ts +0 -1
- package/src/routes/locations/location-list/components/location-list-header/location-list-header.tsx +0 -21
- package/src/routes/locations/location-list/loader.ts +0 -36
- package/src/routes/refund-reasons/common/hooks/use-delete-refund-reason-action.tsx +0 -34
- package/src/routes/refund-reasons/refund-reason-create/components/refund-reason-create-form/index.ts +0 -1
- package/src/routes/refund-reasons/refund-reason-create/components/refund-reason-create-form/refund-reason-create-form.tsx +0 -131
- package/src/routes/refund-reasons/refund-reason-create/index.ts +0 -1
- package/src/routes/refund-reasons/refund-reason-create/refund-reason-create.tsx +0 -10
- package/src/routes/refund-reasons/refund-reason-edit/components/refund-reason-edit-form/index.ts +0 -1
- package/src/routes/refund-reasons/refund-reason-edit/components/refund-reason-edit-form/refund-reason-edit-form.tsx +0 -119
- package/src/routes/refund-reasons/refund-reason-edit/index.ts +0 -1
- package/src/routes/refund-reasons/refund-reason-edit/refund-reason-edit.tsx +0 -33
- package/src/routes/refund-reasons/refund-reason-list/components/refund-reason-list-table/index.ts +0 -1
- package/src/routes/refund-reasons/refund-reason-list/components/refund-reason-list-table/refund-reason-list-table.tsx +0 -131
- package/src/routes/refund-reasons/refund-reason-list/index.ts +0 -2
- package/src/routes/refund-reasons/refund-reason-list/loader.ts +0 -16
- package/src/routes/refund-reasons/refund-reason-list/refund-reason-list.tsx +0 -21
@@ -1,297 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
BadgeListSummary
|
3
|
-
} from "./chunk-BKJC5BGQ.mjs";
|
4
|
-
import "./chunk-PYIO3TDQ.mjs";
|
5
|
-
import {
|
6
|
-
LinkButton
|
7
|
-
} from "./chunk-6WKBBTKM.mjs";
|
8
|
-
import {
|
9
|
-
SidebarLink
|
10
|
-
} from "./chunk-LBIOZZPA.mjs";
|
11
|
-
import "./chunk-EQTBJSBZ.mjs";
|
12
|
-
import {
|
13
|
-
getFormattedAddress
|
14
|
-
} from "./chunk-B6ZOPCPA.mjs";
|
15
|
-
import {
|
16
|
-
TwoColumnPage
|
17
|
-
} from "./chunk-2RQLKDBF.mjs";
|
18
|
-
import {
|
19
|
-
useExtension
|
20
|
-
} from "./chunk-C5P5PL3E.mjs";
|
21
|
-
import "./chunk-DG7J63J2.mjs";
|
22
|
-
import {
|
23
|
-
ActionMenu
|
24
|
-
} from "./chunk-3NJTXRIY.mjs";
|
25
|
-
import "./chunk-OC7BQLYI.mjs";
|
26
|
-
import {
|
27
|
-
stockLocationsQueryKeys,
|
28
|
-
useDeleteStockLocation,
|
29
|
-
useStockLocations
|
30
|
-
} from "./chunk-32IQRUVY.mjs";
|
31
|
-
import {
|
32
|
-
queryClient
|
33
|
-
} from "./chunk-FXYH54JP.mjs";
|
34
|
-
import "./chunk-774WSTCC.mjs";
|
35
|
-
import {
|
36
|
-
sdk
|
37
|
-
} from "./chunk-DEQUVHHE.mjs";
|
38
|
-
import "./chunk-RPUOO7AV.mjs";
|
39
|
-
|
40
|
-
// src/routes/locations/location-list/loader.ts
|
41
|
-
import { redirect } from "react-router-dom";
|
42
|
-
|
43
|
-
// src/routes/locations/location-list/constants.ts
|
44
|
-
var LOCATION_LIST_FIELDS = "name,*sales_channels,*address,*fulfillment_sets,*fulfillment_sets.service_zones,*fulfillment_sets.service_zones.shipping_options,*fulfillment_sets.service_zones.shipping_options.shipping_profile";
|
45
|
-
|
46
|
-
// src/routes/locations/location-list/loader.ts
|
47
|
-
var shippingListQuery = () => ({
|
48
|
-
queryKey: stockLocationsQueryKeys.lists(),
|
49
|
-
queryFn: async () => {
|
50
|
-
return await sdk.admin.stockLocation.list({
|
51
|
-
// TODO: change this when RQ is fixed
|
52
|
-
fields: LOCATION_LIST_FIELDS
|
53
|
-
}).catch((error) => {
|
54
|
-
if (error.status === 401) {
|
55
|
-
throw redirect("/login");
|
56
|
-
}
|
57
|
-
throw error;
|
58
|
-
});
|
59
|
-
}
|
60
|
-
});
|
61
|
-
var shippingListLoader = async (_) => {
|
62
|
-
const query = shippingListQuery();
|
63
|
-
return queryClient.getQueryData(
|
64
|
-
query.queryKey
|
65
|
-
) ?? await queryClient.fetchQuery(query);
|
66
|
-
};
|
67
|
-
|
68
|
-
// src/routes/locations/location-list/location-list.tsx
|
69
|
-
import { ShoppingBag, TruckFast } from "@medusajs/icons";
|
70
|
-
import { Container as Container3, Heading as Heading2 } from "@medusajs/ui";
|
71
|
-
import { useTranslation as useTranslation3 } from "react-i18next";
|
72
|
-
import { useLoaderData } from "react-router-dom";
|
73
|
-
|
74
|
-
// src/routes/locations/location-list/components/location-list-item/location-list-item.tsx
|
75
|
-
import { Buildings, PencilSquare, Trash } from "@medusajs/icons";
|
76
|
-
import { Container, StatusBadge, Text, toast, usePrompt } from "@medusajs/ui";
|
77
|
-
import { useTranslation } from "react-i18next";
|
78
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
79
|
-
function SalesChannels(props) {
|
80
|
-
const { t } = useTranslation();
|
81
|
-
const { salesChannels } = props;
|
82
|
-
return /* @__PURE__ */ jsx("div", { className: "flex flex-col px-6 py-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
83
|
-
/* @__PURE__ */ jsx(
|
84
|
-
Text,
|
85
|
-
{
|
86
|
-
size: "small",
|
87
|
-
weight: "plus",
|
88
|
-
className: "text-ui-fg-subtle flex-1",
|
89
|
-
as: "div",
|
90
|
-
children: t(`stockLocations.salesChannels.label`)
|
91
|
-
}
|
92
|
-
),
|
93
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 text-left", children: salesChannels?.length ? /* @__PURE__ */ jsx(
|
94
|
-
BadgeListSummary,
|
95
|
-
{
|
96
|
-
rounded: true,
|
97
|
-
inline: true,
|
98
|
-
n: 3,
|
99
|
-
list: salesChannels.map((s) => s.name)
|
100
|
-
}
|
101
|
-
) : "-" })
|
102
|
-
] }) });
|
103
|
-
}
|
104
|
-
function FulfillmentSet(props) {
|
105
|
-
const { t } = useTranslation();
|
106
|
-
const { fulfillmentSet, type } = props;
|
107
|
-
const fulfillmentSetExists = !!fulfillmentSet;
|
108
|
-
return /* @__PURE__ */ jsx("div", { className: "flex flex-col px-6 py-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
109
|
-
/* @__PURE__ */ jsx(
|
110
|
-
Text,
|
111
|
-
{
|
112
|
-
size: "small",
|
113
|
-
weight: "plus",
|
114
|
-
className: "text-ui-fg-subtle flex-1",
|
115
|
-
as: "div",
|
116
|
-
children: t(`stockLocations.fulfillmentSets.${type}.header`)
|
117
|
-
}
|
118
|
-
),
|
119
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 text-left", children: /* @__PURE__ */ jsx(StatusBadge, { color: fulfillmentSetExists ? "green" : "grey", children: t(fulfillmentSetExists ? "statuses.enabled" : "statuses.disabled") }) })
|
120
|
-
] }) });
|
121
|
-
}
|
122
|
-
function LocationListItem(props) {
|
123
|
-
const { location } = props;
|
124
|
-
const { t } = useTranslation();
|
125
|
-
const prompt = usePrompt();
|
126
|
-
const { mutateAsync: deleteLocation } = useDeleteStockLocation(location.id);
|
127
|
-
const handleDelete = async () => {
|
128
|
-
const result = await prompt({
|
129
|
-
title: t("general.areYouSure"),
|
130
|
-
description: t("stockLocations.delete.confirmation", {
|
131
|
-
name: location.name
|
132
|
-
}),
|
133
|
-
confirmText: t("actions.remove"),
|
134
|
-
cancelText: t("actions.cancel")
|
135
|
-
});
|
136
|
-
if (!result) {
|
137
|
-
return;
|
138
|
-
}
|
139
|
-
await deleteLocation(void 0, {
|
140
|
-
onSuccess: () => {
|
141
|
-
toast.success(
|
142
|
-
t("shippingProfile.delete.successToast", {
|
143
|
-
name: location.name
|
144
|
-
})
|
145
|
-
);
|
146
|
-
},
|
147
|
-
onError: (e) => {
|
148
|
-
toast.error(e.message);
|
149
|
-
}
|
150
|
-
});
|
151
|
-
};
|
152
|
-
return /* @__PURE__ */ jsxs(Container, { className: "flex flex-col divide-y p-0", children: [
|
153
|
-
/* @__PURE__ */ jsx("div", { className: "px-6 py-4", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-between gap-x-4", children: [
|
154
|
-
/* @__PURE__ */ jsx("div", { className: "shadow-borders-base flex size-7 items-center justify-center rounded-md", children: /* @__PURE__ */ jsx("div", { className: "bg-ui-bg-field flex size-6 items-center justify-center rounded-[4px]", children: /* @__PURE__ */ jsx(Buildings, { className: "text-ui-fg-subtle" }) }) }),
|
155
|
-
/* @__PURE__ */ jsxs("div", { className: "grow-1 flex flex-1 flex-col", children: [
|
156
|
-
/* @__PURE__ */ jsx(Text, { weight: "plus", children: location.name }),
|
157
|
-
/* @__PURE__ */ jsx(Text, { className: "text-ui-fg-subtle txt-small", children: getFormattedAddress({ address: location.address }).join(", ") })
|
158
|
-
] }),
|
159
|
-
/* @__PURE__ */ jsxs("div", { className: "flex grow-0 items-center gap-4", children: [
|
160
|
-
/* @__PURE__ */ jsx(
|
161
|
-
ActionMenu,
|
162
|
-
{
|
163
|
-
groups: [
|
164
|
-
{
|
165
|
-
actions: [
|
166
|
-
{
|
167
|
-
label: t("actions.edit"),
|
168
|
-
icon: /* @__PURE__ */ jsx(PencilSquare, {}),
|
169
|
-
to: `/settings/locations/${location.id}/edit`
|
170
|
-
}
|
171
|
-
]
|
172
|
-
},
|
173
|
-
{
|
174
|
-
actions: [
|
175
|
-
{
|
176
|
-
label: t("actions.delete"),
|
177
|
-
icon: /* @__PURE__ */ jsx(Trash, {}),
|
178
|
-
onClick: handleDelete
|
179
|
-
}
|
180
|
-
]
|
181
|
-
}
|
182
|
-
]
|
183
|
-
}
|
184
|
-
),
|
185
|
-
/* @__PURE__ */ jsx("div", { className: "bg-ui-border-strong h-[12px] w-[1px]" }),
|
186
|
-
/* @__PURE__ */ jsx(LinkButton, { to: `/settings/locations/${location.id}`, children: t("actions.viewDetails") })
|
187
|
-
] })
|
188
|
-
] }) }),
|
189
|
-
/* @__PURE__ */ jsx(SalesChannels, { salesChannels: location.sales_channels }),
|
190
|
-
/* @__PURE__ */ jsx(
|
191
|
-
FulfillmentSet,
|
192
|
-
{
|
193
|
-
type: "pickup" /* Pickup */,
|
194
|
-
fulfillmentSet: location.fulfillment_sets?.find(
|
195
|
-
(f) => f.type === "pickup" /* Pickup */
|
196
|
-
)
|
197
|
-
}
|
198
|
-
),
|
199
|
-
/* @__PURE__ */ jsx(
|
200
|
-
FulfillmentSet,
|
201
|
-
{
|
202
|
-
type: "shipping" /* Shipping */,
|
203
|
-
fulfillmentSet: location.fulfillment_sets?.find(
|
204
|
-
(f) => f.type === "shipping" /* Shipping */
|
205
|
-
)
|
206
|
-
}
|
207
|
-
)
|
208
|
-
] });
|
209
|
-
}
|
210
|
-
var location_list_item_default = LocationListItem;
|
211
|
-
|
212
|
-
// src/routes/locations/location-list/components/location-list-header/location-list-header.tsx
|
213
|
-
import { Button, Container as Container2, Heading, Text as Text2 } from "@medusajs/ui";
|
214
|
-
import { useTranslation as useTranslation2 } from "react-i18next";
|
215
|
-
import { Link } from "react-router-dom";
|
216
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
217
|
-
var LocationListHeader = () => {
|
218
|
-
const { t } = useTranslation2();
|
219
|
-
return /* @__PURE__ */ jsxs2(Container2, { className: "flex h-fit items-center justify-between gap-x-4 px-6 py-4", children: [
|
220
|
-
/* @__PURE__ */ jsxs2("div", { children: [
|
221
|
-
/* @__PURE__ */ jsx2(Heading, { children: t("stockLocations.domain") }),
|
222
|
-
/* @__PURE__ */ jsx2(Text2, { className: "text-ui-fg-subtle txt-small", children: t("stockLocations.list.description") })
|
223
|
-
] }),
|
224
|
-
/* @__PURE__ */ jsx2(Button, { size: "small", className: "shrink-0", variant: "secondary", asChild: true, children: /* @__PURE__ */ jsx2(Link, { to: "create", children: t("actions.create") }) })
|
225
|
-
] });
|
226
|
-
};
|
227
|
-
|
228
|
-
// src/routes/locations/location-list/location-list.tsx
|
229
|
-
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
230
|
-
function LocationList() {
|
231
|
-
const initialData = useLoaderData();
|
232
|
-
const {
|
233
|
-
stock_locations: stockLocations = [],
|
234
|
-
isError,
|
235
|
-
error
|
236
|
-
} = useStockLocations(
|
237
|
-
{
|
238
|
-
fields: LOCATION_LIST_FIELDS
|
239
|
-
},
|
240
|
-
{ initialData }
|
241
|
-
);
|
242
|
-
const { getWidgets } = useExtension();
|
243
|
-
if (isError) {
|
244
|
-
throw error;
|
245
|
-
}
|
246
|
-
return /* @__PURE__ */ jsxs3(
|
247
|
-
TwoColumnPage,
|
248
|
-
{
|
249
|
-
widgets: {
|
250
|
-
after: getWidgets("location.list.after"),
|
251
|
-
before: getWidgets("location.list.before"),
|
252
|
-
sideAfter: getWidgets("location.list.side.after"),
|
253
|
-
sideBefore: getWidgets("location.list.side.before")
|
254
|
-
},
|
255
|
-
showJSON: true,
|
256
|
-
children: [
|
257
|
-
/* @__PURE__ */ jsxs3(TwoColumnPage.Main, { children: [
|
258
|
-
/* @__PURE__ */ jsx3(LocationListHeader, {}),
|
259
|
-
/* @__PURE__ */ jsx3("div", { className: "flex flex-col gap-3 lg:col-span-2", children: stockLocations.map((location) => /* @__PURE__ */ jsx3(location_list_item_default, { location }, location.id)) })
|
260
|
-
] }),
|
261
|
-
/* @__PURE__ */ jsx3(TwoColumnPage.Sidebar, { children: /* @__PURE__ */ jsx3(LinksSection, {}) })
|
262
|
-
]
|
263
|
-
}
|
264
|
-
);
|
265
|
-
}
|
266
|
-
var LinksSection = () => {
|
267
|
-
const { t } = useTranslation3();
|
268
|
-
return /* @__PURE__ */ jsxs3(Container3, { className: "p-0", children: [
|
269
|
-
/* @__PURE__ */ jsx3("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsx3(Heading2, { level: "h2", children: t("stockLocations.sidebar.header") }) }),
|
270
|
-
/* @__PURE__ */ jsx3(
|
271
|
-
SidebarLink,
|
272
|
-
{
|
273
|
-
to: "/settings/locations/shipping-profiles",
|
274
|
-
labelKey: t("stockLocations.sidebar.shippingProfiles.label"),
|
275
|
-
descriptionKey: t(
|
276
|
-
"stockLocations.sidebar.shippingProfiles.description"
|
277
|
-
),
|
278
|
-
icon: /* @__PURE__ */ jsx3(ShoppingBag, {})
|
279
|
-
}
|
280
|
-
),
|
281
|
-
/* @__PURE__ */ jsx3(
|
282
|
-
SidebarLink,
|
283
|
-
{
|
284
|
-
to: "/settings/locations/shipping-option-types",
|
285
|
-
labelKey: t("stockLocations.sidebar.shippingOptionTypes.label"),
|
286
|
-
descriptionKey: t(
|
287
|
-
"stockLocations.sidebar.shippingOptionTypes.description"
|
288
|
-
),
|
289
|
-
icon: /* @__PURE__ */ jsx3(TruckFast, {})
|
290
|
-
}
|
291
|
-
)
|
292
|
-
] });
|
293
|
-
};
|
294
|
-
export {
|
295
|
-
LocationList as Component,
|
296
|
-
shippingListLoader as loader
|
297
|
-
};
|
@@ -1,158 +0,0 @@
|
|
1
|
-
import "./chunk-IUCDCPJU.mjs";
|
2
|
-
import {
|
3
|
-
KeyboundForm
|
4
|
-
} from "./chunk-6HTZNHPT.mjs";
|
5
|
-
import {
|
6
|
-
RouteFocusModal,
|
7
|
-
useRouteModal
|
8
|
-
} from "./chunk-4TC5YS65.mjs";
|
9
|
-
import {
|
10
|
-
Form
|
11
|
-
} from "./chunk-OBQI23QM.mjs";
|
12
|
-
import "./chunk-BSBCIU6C.mjs";
|
13
|
-
import "./chunk-KOSCMAIC.mjs";
|
14
|
-
import {
|
15
|
-
useCreateRefundReason
|
16
|
-
} from "./chunk-YZJ3W776.mjs";
|
17
|
-
import "./chunk-X6DSNTTX.mjs";
|
18
|
-
import "./chunk-I6E6CALJ.mjs";
|
19
|
-
import "./chunk-4RG7UJCT.mjs";
|
20
|
-
import "./chunk-QTCZFYFH.mjs";
|
21
|
-
import "./chunk-B4GODIOW.mjs";
|
22
|
-
import "./chunk-ENV6YVOM.mjs";
|
23
|
-
import "./chunk-PIR2H25N.mjs";
|
24
|
-
import "./chunk-RLY2SL5E.mjs";
|
25
|
-
import "./chunk-C5LYZZZ5.mjs";
|
26
|
-
import "./chunk-2ZKVRTBW.mjs";
|
27
|
-
import "./chunk-ZCZL3STK.mjs";
|
28
|
-
import "./chunk-OHSRRFGN.mjs";
|
29
|
-
import "./chunk-F6PXCY3N.mjs";
|
30
|
-
import "./chunk-NCR5UWRI.mjs";
|
31
|
-
import "./chunk-ZODJNBAV.mjs";
|
32
|
-
import "./chunk-GRT22PE5.mjs";
|
33
|
-
import "./chunk-32IQRUVY.mjs";
|
34
|
-
import "./chunk-KSRI5LOF.mjs";
|
35
|
-
import "./chunk-YI4CZGTU.mjs";
|
36
|
-
import "./chunk-BFNH5UWD.mjs";
|
37
|
-
import "./chunk-KX4P5L3R.mjs";
|
38
|
-
import "./chunk-4Q4LIFFO.mjs";
|
39
|
-
import "./chunk-V2LANK5S.mjs";
|
40
|
-
import "./chunk-QZ6PT4QV.mjs";
|
41
|
-
import "./chunk-QL4XKIVL.mjs";
|
42
|
-
import "./chunk-X4X5KUGQ.mjs";
|
43
|
-
import "./chunk-FXYH54JP.mjs";
|
44
|
-
import "./chunk-774WSTCC.mjs";
|
45
|
-
import "./chunk-DEQUVHHE.mjs";
|
46
|
-
import "./chunk-RPUOO7AV.mjs";
|
47
|
-
|
48
|
-
// src/routes/refund-reasons/refund-reason-create/components/refund-reason-create-form/refund-reason-create-form.tsx
|
49
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
50
|
-
import { Button, Heading, Input, Text, Textarea, toast } from "@medusajs/ui";
|
51
|
-
import { useForm } from "react-hook-form";
|
52
|
-
import { useTranslation } from "react-i18next";
|
53
|
-
import { z } from "zod";
|
54
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
55
|
-
var RefundReasonCreateSchema = z.object({
|
56
|
-
label: z.string().min(1),
|
57
|
-
description: z.string().optional()
|
58
|
-
});
|
59
|
-
var RefundReasonCreateForm = () => {
|
60
|
-
const { t } = useTranslation();
|
61
|
-
const { handleSuccess } = useRouteModal();
|
62
|
-
const form = useForm({
|
63
|
-
defaultValues: {
|
64
|
-
label: "",
|
65
|
-
description: ""
|
66
|
-
},
|
67
|
-
resolver: zodResolver(RefundReasonCreateSchema)
|
68
|
-
});
|
69
|
-
const { mutateAsync, isPending } = useCreateRefundReason();
|
70
|
-
const handleSubmit = form.handleSubmit(async (data) => {
|
71
|
-
await mutateAsync(data, {
|
72
|
-
onSuccess: ({ refund_reason }) => {
|
73
|
-
toast.success(
|
74
|
-
t("refundReasons.create.successToast", {
|
75
|
-
label: refund_reason.label
|
76
|
-
})
|
77
|
-
);
|
78
|
-
handleSuccess(`../`);
|
79
|
-
},
|
80
|
-
onError: (error) => {
|
81
|
-
toast.error(error.message);
|
82
|
-
}
|
83
|
-
});
|
84
|
-
});
|
85
|
-
return /* @__PURE__ */ jsx(RouteFocusModal.Form, { form, children: /* @__PURE__ */ jsxs(
|
86
|
-
KeyboundForm,
|
87
|
-
{
|
88
|
-
className: "flex size-full flex-col overflow-hidden",
|
89
|
-
onSubmit: handleSubmit,
|
90
|
-
children: [
|
91
|
-
/* @__PURE__ */ jsx(RouteFocusModal.Header, {}),
|
92
|
-
/* @__PURE__ */ jsx(RouteFocusModal.Body, { className: "flex flex-1 justify-center overflow-auto px-6 py-16", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
|
93
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-1", children: [
|
94
|
-
/* @__PURE__ */ jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: t("refundReasons.create.header") }) }),
|
95
|
-
/* @__PURE__ */ jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: t("refundReasons.create.subtitle") }) })
|
96
|
-
] }),
|
97
|
-
/* @__PURE__ */ jsx("div", { className: "grid gap-4 md:grid-cols-2", children: /* @__PURE__ */ jsx(
|
98
|
-
Form.Field,
|
99
|
-
{
|
100
|
-
control: form.control,
|
101
|
-
name: "label",
|
102
|
-
render: ({ field }) => {
|
103
|
-
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
104
|
-
/* @__PURE__ */ jsx(Form.Label, { children: t("refundReasons.fields.label.label") }),
|
105
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
106
|
-
Input,
|
107
|
-
{
|
108
|
-
...field,
|
109
|
-
placeholder: t(
|
110
|
-
"refundReasons.fields.label.placeholder"
|
111
|
-
)
|
112
|
-
}
|
113
|
-
) }),
|
114
|
-
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
115
|
-
] });
|
116
|
-
}
|
117
|
-
}
|
118
|
-
) }),
|
119
|
-
/* @__PURE__ */ jsx(
|
120
|
-
Form.Field,
|
121
|
-
{
|
122
|
-
control: form.control,
|
123
|
-
name: "description",
|
124
|
-
render: ({ field }) => {
|
125
|
-
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
126
|
-
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("refundReasons.fields.description.label") }),
|
127
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
128
|
-
Textarea,
|
129
|
-
{
|
130
|
-
...field,
|
131
|
-
placeholder: t(
|
132
|
-
"refundReasons.fields.description.placeholder"
|
133
|
-
)
|
134
|
-
}
|
135
|
-
) }),
|
136
|
-
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
137
|
-
] });
|
138
|
-
}
|
139
|
-
}
|
140
|
-
)
|
141
|
-
] }) }),
|
142
|
-
/* @__PURE__ */ jsx(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-2", children: [
|
143
|
-
/* @__PURE__ */ jsx(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", type: "button", children: t("actions.cancel") }) }),
|
144
|
-
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: t("actions.save") })
|
145
|
-
] }) })
|
146
|
-
]
|
147
|
-
}
|
148
|
-
) });
|
149
|
-
};
|
150
|
-
|
151
|
-
// src/routes/refund-reasons/refund-reason-create/refund-reason-create.tsx
|
152
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
153
|
-
var RefundReasonCreate = () => {
|
154
|
-
return /* @__PURE__ */ jsx2(RouteFocusModal, { children: /* @__PURE__ */ jsx2(RefundReasonCreateForm, {}) });
|
155
|
-
};
|
156
|
-
export {
|
157
|
-
RefundReasonCreate as Component
|
158
|
-
};
|
@@ -1,144 +0,0 @@
|
|
1
|
-
import "./chunk-IUCDCPJU.mjs";
|
2
|
-
import {
|
3
|
-
KeyboundForm
|
4
|
-
} from "./chunk-6HTZNHPT.mjs";
|
5
|
-
import {
|
6
|
-
RouteDrawer,
|
7
|
-
useRouteModal
|
8
|
-
} from "./chunk-4TC5YS65.mjs";
|
9
|
-
import {
|
10
|
-
Form
|
11
|
-
} from "./chunk-OBQI23QM.mjs";
|
12
|
-
import {
|
13
|
-
useRefundReason,
|
14
|
-
useUpdateRefundReason
|
15
|
-
} from "./chunk-YZJ3W776.mjs";
|
16
|
-
import "./chunk-FXYH54JP.mjs";
|
17
|
-
import "./chunk-774WSTCC.mjs";
|
18
|
-
import "./chunk-DEQUVHHE.mjs";
|
19
|
-
import "./chunk-RPUOO7AV.mjs";
|
20
|
-
|
21
|
-
// src/routes/refund-reasons/refund-reason-edit/refund-reason-edit.tsx
|
22
|
-
import { Heading } from "@medusajs/ui";
|
23
|
-
import { useTranslation as useTranslation2 } from "react-i18next";
|
24
|
-
import { useParams } from "react-router-dom";
|
25
|
-
|
26
|
-
// src/routes/refund-reasons/refund-reason-edit/components/refund-reason-edit-form/refund-reason-edit-form.tsx
|
27
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
28
|
-
import { Button, Input, Textarea, toast } from "@medusajs/ui";
|
29
|
-
import { useForm } from "react-hook-form";
|
30
|
-
import { useTranslation } from "react-i18next";
|
31
|
-
import { z } from "zod";
|
32
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
33
|
-
var RefundReasonEditSchema = z.object({
|
34
|
-
label: z.string().min(1),
|
35
|
-
description: z.string().optional()
|
36
|
-
});
|
37
|
-
var RefundReasonEditForm = ({
|
38
|
-
refundReason
|
39
|
-
}) => {
|
40
|
-
const { t } = useTranslation();
|
41
|
-
const { handleSuccess } = useRouteModal();
|
42
|
-
const form = useForm({
|
43
|
-
defaultValues: {
|
44
|
-
label: refundReason.label,
|
45
|
-
description: refundReason.description ?? void 0
|
46
|
-
},
|
47
|
-
resolver: zodResolver(RefundReasonEditSchema)
|
48
|
-
});
|
49
|
-
const { mutateAsync, isPending } = useUpdateRefundReason(refundReason.id);
|
50
|
-
const handleSubmit = form.handleSubmit(async (data) => {
|
51
|
-
await mutateAsync(data, {
|
52
|
-
onSuccess: ({ refund_reason }) => {
|
53
|
-
toast.success(
|
54
|
-
t("refundReasons.edit.successToast", {
|
55
|
-
label: refund_reason.label
|
56
|
-
})
|
57
|
-
);
|
58
|
-
handleSuccess();
|
59
|
-
},
|
60
|
-
onError: (error) => {
|
61
|
-
toast.error(error.message);
|
62
|
-
}
|
63
|
-
});
|
64
|
-
});
|
65
|
-
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
|
66
|
-
KeyboundForm,
|
67
|
-
{
|
68
|
-
className: "flex size-full flex-col overflow-hidden",
|
69
|
-
onSubmit: handleSubmit,
|
70
|
-
children: [
|
71
|
-
/* @__PURE__ */ jsxs(RouteDrawer.Body, { className: "flex flex-1 flex-col gap-y-4 overflow-auto", children: [
|
72
|
-
/* @__PURE__ */ jsx(
|
73
|
-
Form.Field,
|
74
|
-
{
|
75
|
-
control: form.control,
|
76
|
-
name: "label",
|
77
|
-
render: ({ field }) => {
|
78
|
-
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
79
|
-
/* @__PURE__ */ jsx(Form.Label, { children: t("refundReasons.fields.label.label") }),
|
80
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
81
|
-
Input,
|
82
|
-
{
|
83
|
-
...field,
|
84
|
-
placeholder: t("refundReasons.fields.label.placeholder")
|
85
|
-
}
|
86
|
-
) }),
|
87
|
-
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
88
|
-
] });
|
89
|
-
}
|
90
|
-
}
|
91
|
-
),
|
92
|
-
/* @__PURE__ */ jsx(
|
93
|
-
Form.Field,
|
94
|
-
{
|
95
|
-
control: form.control,
|
96
|
-
name: "description",
|
97
|
-
render: ({ field }) => {
|
98
|
-
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
99
|
-
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("refundReasons.fields.description.label") }),
|
100
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
101
|
-
Textarea,
|
102
|
-
{
|
103
|
-
...field,
|
104
|
-
placeholder: t(
|
105
|
-
"refundReasons.fields.description.placeholder"
|
106
|
-
)
|
107
|
-
}
|
108
|
-
) }),
|
109
|
-
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
110
|
-
] });
|
111
|
-
}
|
112
|
-
}
|
113
|
-
)
|
114
|
-
] }),
|
115
|
-
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
116
|
-
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "small", type: "button", children: t("actions.cancel") }) }),
|
117
|
-
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: t("actions.save") })
|
118
|
-
] }) })
|
119
|
-
]
|
120
|
-
}
|
121
|
-
) });
|
122
|
-
};
|
123
|
-
|
124
|
-
// src/routes/refund-reasons/refund-reason-edit/refund-reason-edit.tsx
|
125
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
126
|
-
var RefundReasonEdit = () => {
|
127
|
-
const { id } = useParams();
|
128
|
-
const { t } = useTranslation2();
|
129
|
-
const { refund_reason, isPending, isError, error } = useRefundReason(id);
|
130
|
-
const ready = !isPending && !!refund_reason;
|
131
|
-
if (isError) {
|
132
|
-
throw error;
|
133
|
-
}
|
134
|
-
return /* @__PURE__ */ jsxs2(RouteDrawer, { children: [
|
135
|
-
/* @__PURE__ */ jsxs2(RouteDrawer.Header, { children: [
|
136
|
-
/* @__PURE__ */ jsx2(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx2(Heading, { children: t("refundReasons.edit.header") }) }),
|
137
|
-
/* @__PURE__ */ jsx2(RouteDrawer.Description, { className: "sr-only", children: t("refundReasons.edit.subtitle") })
|
138
|
-
] }),
|
139
|
-
ready && /* @__PURE__ */ jsx2(RefundReasonEditForm, { refundReason: refund_reason })
|
140
|
-
] });
|
141
|
-
};
|
142
|
-
export {
|
143
|
-
RefundReasonEdit as Component
|
144
|
-
};
|