@mercurjs/admin 2.1.0-canary.5 → 2.1.0-canary.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{add-campaign-promotions-LE2WUOTX.js → add-campaign-promotions-VKH6RC3R.js} +3 -3
- package/dist/{adjust-inventory-TCBV3PCL.js → adjust-inventory-NVBPZYOF.js} +1 -1
- package/dist/{api-key-management-detail-LH3I7OZB.js → api-key-management-detail-Q5RBMX4J.js} +4 -3
- package/dist/{api-key-management-sales-channels-SCIDNYW5.js → api-key-management-sales-channels-UGAAKILD.js} +2 -1
- package/dist/{attribute-create-CJBFOEGI.js → attribute-create-IVRJPVG5.js} +1 -1
- package/dist/{attribute-detail-2RDAGHQB.js → attribute-detail-E6ILEV4C.js} +1 -1
- package/dist/{attribute-edit-TDMQJYAP.js → attribute-edit-DRHFOHMK.js} +2 -2
- package/dist/{attribute-list-MK2EUELY.js → attribute-list-SFUKKH25.js} +1 -1
- package/dist/{campaign-detail-GVJ3PO4I.js → campaign-detail-OJF24KXP.js} +5 -5
- package/dist/{categories-metadata-M3GDS27H.js → categories-metadata-YVUNHMQT.js} +1 -1
- package/dist/{category-create-5WS4XGYI.js → category-create-XH6AM3NM.js} +2 -2
- package/dist/{category-detail-TTJ6XGLM.js → category-detail-YELQ7OSB.js} +3 -3
- package/dist/{category-edit-GOB4ASBP.js → category-edit-IXU6E3YT.js} +1 -1
- package/dist/{category-products-NRPWJHDW.js → category-products-G6XFVWWK.js} +2 -2
- package/dist/{chunk-PXZQSL5A.js → chunk-22YCBNLL.js} +1 -1
- package/dist/{chunk-LAN52TLS.js → chunk-3LPDWXLV.js} +1 -1
- package/dist/{chunk-YSGXL7CX.js → chunk-3WQCJEAS.js} +1 -1
- package/dist/{chunk-YFSTGK5R.js → chunk-6BOPJWOS.js} +1 -1
- package/dist/{chunk-GBRUBIGE.js → chunk-6F6T6O6R.js} +1 -1
- package/dist/{chunk-QFOEY6RN.js → chunk-C2GSCU65.js} +5 -63
- package/dist/{chunk-X2X7M3B6.js → chunk-C43DG3K3.js} +1 -1
- package/dist/{chunk-NZN7PFPB.js → chunk-CKNQJPAG.js} +6 -40
- package/dist/{chunk-AQANSGTS.js → chunk-DW7BD2BR.js} +26 -6
- package/dist/{chunk-BH5LSB6O.js → chunk-EV6CDI37.js} +1 -1
- package/dist/{chunk-UROZLRSZ.js → chunk-F2ZHPWHP.js} +1 -1
- package/dist/{chunk-5XENZ4RY.js → chunk-FCQMQF2U.js} +3 -3
- package/dist/{chunk-AVUWXDRQ.js → chunk-G2GB77RC.js} +1 -1
- package/dist/chunk-HJ56YXBU.js +46 -0
- package/dist/{chunk-SIM42VD3.js → chunk-IK6MPP7K.js} +1 -1
- package/dist/{chunk-T3E6EVLQ.js → chunk-IO3TLOTN.js} +1 -1
- package/dist/{chunk-2FLBJM53.js → chunk-LEG67A2R.js} +0 -16
- package/dist/{chunk-TBRKUYQX.js → chunk-LGYQGZNR.js} +1 -1
- package/dist/{chunk-SUQJGDPA.js → chunk-LNAXUDW2.js} +1 -1
- package/dist/{chunk-KZE2BXFZ.js → chunk-M3LFFRPG.js} +1 -1
- package/dist/chunk-MDABSESI.js +38 -0
- package/dist/{chunk-DGSPRILL.js → chunk-MVSHIITK.js} +1 -1
- package/dist/{chunk-LRCMPXIA.js → chunk-NUMAHMW2.js} +1 -1
- package/dist/{chunk-AVW3A7X5.js → chunk-NZ4BXIO6.js} +1 -1
- package/dist/{chunk-N46VH2AV.js → chunk-QONWYA46.js} +1 -1
- package/dist/{chunk-J73MGZ2C.js → chunk-SZO2SCY2.js} +1 -1
- package/dist/{chunk-DKIXS7MS.js → chunk-T3ZRBKEC.js} +179 -200
- package/dist/{chunk-DMWRKJV5.js → chunk-Z4OJNCER.js} +1 -1
- package/dist/{chunk-RXBYBQDN.js → chunk-ZFQ5XQ2W.js} +1 -1
- package/dist/{collection-add-products-V34BC5KZ.js → collection-add-products-VSSL3PJV.js} +2 -2
- package/dist/{collection-create-T3I4AQ6T.js → collection-create-3BTRORHU.js} +1 -1
- package/dist/{collection-detail-FBF245L5.js → collection-detail-AAD4X24M.js} +3 -3
- package/dist/{collection-list-2NU2RHF6.js → collection-list-J32PG7BB.js} +2 -2
- package/dist/{collection-metadata-4CATBMBR.js → collection-metadata-KHGPTV5C.js} +1 -1
- package/dist/{commission-rate-create-BX5ON475.js → commission-rate-create-KTQR4WCZ.js} +3 -3
- package/dist/{commission-rate-detail-2FIUCRWQ.js → commission-rate-detail-7I4M7GOE.js} +1 -1
- package/dist/{commission-rate-edit-QO54ISLU.js → commission-rate-edit-52CJF2EX.js} +3 -3
- package/dist/{customer-detail-X7RDPYCB.js → customer-detail-4J4RSVSG.js} +1 -1
- package/dist/{customer-group-detail-LG45HYN7.js → customer-group-detail-KCKJEPSN.js} +1 -1
- package/dist/{customer-group-list-AKB2QL2I.js → customer-group-list-IQGAXHVE.js} +1 -1
- package/dist/{customer-group-metadata-5EY56USK.js → customer-group-metadata-YJXZFSFG.js} +1 -1
- package/dist/{customer-metadata-UI7VJNBB.js → customer-metadata-SG6M7X3Q.js} +1 -1
- package/dist/{customers-add-customer-group-WXARGETR.js → customers-add-customer-group-ASX6POFR.js} +1 -1
- package/dist/{edit-inventory-item-7LUBIEJG.js → edit-inventory-item-TDG2ZTPM.js} +1 -1
- package/dist/{edit-inventory-item-attributes-GPWA3SHB.js → edit-inventory-item-attributes-T56PJTCT.js} +1 -1
- package/dist/{edit-rules-MOJW3IY6.js → edit-rules-BRXIELG2.js} +1 -1
- package/dist/index.js +153 -153
- package/dist/{inventory-create-G4PFD6IN.js → inventory-create-3GAK5IYZ.js} +1 -1
- package/dist/{inventory-detail-N2YB6A4C.js → inventory-detail-KU5IMRS6.js} +1 -1
- package/dist/{inventory-metadata-R35MGH5G.js → inventory-metadata-LUGA3KNV.js} +1 -1
- package/dist/{inventory-stock-VKNHPP3I.js → inventory-stock-JZNONQAL.js} +1 -1
- package/dist/{location-detail-SHY5JFEP.js → location-detail-RY65FCD3.js} +1 -1
- package/dist/{location-fulfillment-providers-XJWKGU5I.js → location-fulfillment-providers-FNXAQUCV.js} +2 -2
- package/dist/{location-list-B4EVW7LE.js → location-list-XGFUQY7T.js} +1 -1
- package/dist/{location-sales-channels-D5SNTEWM.js → location-sales-channels-IRGVGAVC.js} +2 -1
- package/dist/{location-service-zone-shipping-option-create-VKRDPJY5.js → location-service-zone-shipping-option-create-OOU6YVRS.js} +1 -1
- package/dist/{login-GQ2TKLJX.js → login-T5DP5BZ3.js} +1 -1
- package/dist/{marketplace-detail-D5AXFDDY.js → marketplace-detail-QQ2WZ27G.js} +1 -1
- package/dist/{marketplace-metadata-6E3EUPQR.js → marketplace-metadata-VYCPYFJD.js} +1 -1
- package/dist/{order-create-claim-TASIQWLS.js → order-create-claim-GAGJ7QNH.js} +1 -1
- package/dist/{order-create-edit-AEWAUNSL.js → order-create-edit-R5AK2LPP.js} +1 -1
- package/dist/{order-create-exchange-BZULQKWC.js → order-create-exchange-P3PLSEME.js} +1 -1
- package/dist/{order-create-fulfillment-ZQLJDGCV.js → order-create-fulfillment-BB2FCLAH.js} +1 -1
- package/dist/{order-create-refund-MPWH7PYP.js → order-create-refund-LDODI2AP.js} +1 -1
- package/dist/{order-create-shipment-UDYZFTKL.js → order-create-shipment-7XP6PDTD.js} +1 -1
- package/dist/{order-detail-43QRHVIH.js → order-detail-RL4RFNAM.js} +1 -1
- package/dist/{order-edit-billing-address-6PKPD4GI.js → order-edit-billing-address-C5OLRWHW.js} +2 -2
- package/dist/{order-edit-email-TRDITOOM.js → order-edit-email-AZIA6X5Q.js} +1 -1
- package/dist/{order-edit-shipping-address-RU4NGJNM.js → order-edit-shipping-address-GJMUSOPK.js} +1 -1
- package/dist/{order-list-DNYS57KP.js → order-list-UBH5RRTI.js} +2 -2
- package/dist/{order-metadata-AJZBUN36.js → order-metadata-RXIJOP4V.js} +1 -1
- package/dist/{order-receive-return-D5ZVVYMY.js → order-receive-return-6IU2HGAD.js} +1 -1
- package/dist/{order-request-transfer-DAUOVTRI.js → order-request-transfer-6IZVCHGV.js} +1 -1
- package/dist/pages/index.js +28 -27
- package/dist/{price-list-create-NVCPOU2Y.js → price-list-create-VWLNTKY7.js} +3 -3
- package/dist/{price-list-detail-ANVE56H3.js → price-list-detail-3XN7D2PU.js} +3 -3
- package/dist/{price-list-prices-add-JSWTZXIB.js → price-list-prices-add-YY33AL6G.js} +3 -3
- package/dist/{price-list-prices-edit-5OKGMVHM.js → price-list-prices-edit-WSLGG7VC.js} +1 -1
- package/dist/{product-create-B6OYB6QQ.js → product-create-XCQ2TZ7B.js} +7 -6
- package/dist/{product-create-variant-HVY3YA5T.js → product-create-variant-TJB7NNKY.js} +1 -1
- package/dist/{product-detail-IL6J7IDR.js → product-detail-7T5PLGCJ.js} +1 -1
- package/dist/{product-export-FYASMR3R.js → product-export-773L2V63.js} +2 -2
- package/dist/{product-import-RDTWXZSA.js → product-import-JB7S4EL6.js} +1 -1
- package/dist/{product-list-E26DQCLM.js → product-list-5WTGEHDX.js} +3 -3
- package/dist/{product-media-FAZR34OC.js → product-media-4QKZILIM.js} +2 -2
- package/dist/{product-metadata-RYDY2LBO.js → product-metadata-GJ7C2UJG.js} +1 -1
- package/dist/{product-sales-channels-7HVGLKJQ.js → product-sales-channels-53YVZ5G5.js} +2 -1
- package/dist/{product-stock-NXLCWJ7S.js → product-stock-XB3HKT5G.js} +1 -1
- package/dist/{product-tag-create-5JKOHKHR.js → product-tag-create-PHJICTE4.js} +1 -1
- package/dist/{product-tag-detail-4P36B7AC.js → product-tag-detail-DAVCOGGL.js} +3 -3
- package/dist/{product-tag-edit-QZOCJSA3.js → product-tag-edit-G4UNGXPT.js} +1 -1
- package/dist/{product-tag-list-IOUBMHTR.js → product-tag-list-YBRNLXCK.js} +2 -2
- package/dist/{product-tag-metadata-HDTR5225.js → product-tag-metadata-I4V6CR6Z.js} +1 -1
- package/dist/{product-type-detail-57S6OUU7.js → product-type-detail-JEFUXSFV.js} +3 -3
- package/dist/{product-type-metadata-3XHYM7AO.js → product-type-metadata-KGVRMMTQ.js} +1 -1
- package/dist/{product-variant-detail-Q6V67DO7.js → product-variant-detail-S4DAVZFS.js} +1 -1
- package/dist/{product-variant-edit-7RJL2DWH.js → product-variant-edit-L77HDGTA.js} +1 -1
- package/dist/{product-variant-metadata-QHCUMQCQ.js → product-variant-metadata-HV72UBCP.js} +1 -1
- package/dist/{promotion-create-RISO27OH.js → promotion-create-4ZEXEV4G.js} +1 -1
- package/dist/{promotion-detail-BQOADUXZ.js → promotion-detail-DL52RQ5R.js} +4 -4
- package/dist/{promotion-list-6ILZBIJZ.js → promotion-list-CJJNLF5E.js} +4 -4
- package/dist/{refund-reason-create-RWGVYY7U.js → refund-reason-create-M2CYTCEM.js} +1 -1
- package/dist/{refund-reason-edit-F3AKUO4F.js → refund-reason-edit-M4XBV633.js} +1 -1
- package/dist/{refund-reason-list-LOEY5OHX.js → refund-reason-list-VLARTCJF.js} +1 -1
- package/dist/{region-metadata-S5X464KM.js → region-metadata-4JWOEGTZ.js} +1 -1
- package/dist/{reservation-detail-CGAEHOZ6.js → reservation-detail-X3W6APD5.js} +1 -1
- package/dist/{reservation-metadata-55FYLG45.js → reservation-metadata-JFLJ27A3.js} +1 -1
- package/dist/{reset-password-VQXCSILN.js → reset-password-PCKBFFXR.js} +1 -1
- package/dist/{sales-channel-add-products-UNJBYNPM.js → sales-channel-add-products-ABMGZC7O.js} +2 -2
- package/dist/{sales-channel-detail-C62VVFTT.js → sales-channel-detail-PNWRSILX.js} +3 -3
- package/dist/{sales-channel-list-L233THQV.js → sales-channel-list-QKFVTZ6A.js} +4 -3
- package/dist/{sales-channel-metadata-XL6OAO6S.js → sales-channel-metadata-NDSKXOGH.js} +1 -1
- package/dist/{shipping-option-type-create-KSQX5DHV.js → shipping-option-type-create-MEL24PGH.js} +1 -1
- package/dist/{shipping-option-type-detail-NQFIUIZU.js → shipping-option-type-detail-OAKOWHU7.js} +1 -1
- package/dist/{shipping-option-type-edit-P5JP6TGA.js → shipping-option-type-edit-IVBHURXR.js} +1 -1
- package/dist/{shipping-option-type-list-NMG6FSD7.js → shipping-option-type-list-AB2FPIQS.js} +1 -1
- package/dist/{shipping-profile-metadata-YEKUKBUJ.js → shipping-profile-metadata-UZPX2PHJ.js} +1 -1
- package/dist/{store-address-edit-YHL23NAM.js → store-address-edit-PKIBRFH4.js} +37 -40
- package/dist/{store-bulk-edit-3WUPOXIX.js → store-bulk-edit-HCEEME3D.js} +1 -1
- package/dist/{store-closure-edit-LNMWVVWG.js → store-closure-edit-OK7MTUHY.js} +1 -1
- package/dist/{store-create-TDHCGON2.js → store-create-CUH7NDFG.js} +3 -3
- package/dist/{store-details-6THDNDJB.js → store-details-6EJNLLJU.js} +4 -3
- package/dist/{store-edit-LJKBFRJG.js → store-edit-N2V2Z4UU.js} +36 -17
- package/dist/{store-list-UA2GXT7T.js → store-list-TRXWHGBQ.js} +3 -3
- package/dist/{store-member-invite-K76O2YUD.js → store-member-invite-4GDKCSTT.js} +38 -13
- package/dist/{store-payment-details-edit-VD76VCVF.js → store-payment-details-edit-HOGHZMZC.js} +17 -29
- package/dist/{store-professional-details-edit-3QMC5OGO.js → store-professional-details-edit-DPJ4ZFDR.js} +1 -1
- package/dist/{tax-region-create-NVE7TJVZ.js → tax-region-create-UTSDM5EN.js} +2 -2
- package/dist/{tax-region-detail-6W6ZCFKH.js → tax-region-detail-IIKSTR7V.js} +1 -1
- package/dist/{tax-region-edit-XIQISIV6.js → tax-region-edit-OARZRBVK.js} +1 -1
- package/dist/{tax-region-metadata-C2IM452E.js → tax-region-metadata-XJRFOG7I.js} +1 -1
- package/dist/{tax-region-province-detail-EY77MY5Q.js → tax-region-province-detail-SQHBO2XB.js} +1 -1
- package/dist/{tax-region-tax-override-create-RJSVKZGY.js → tax-region-tax-override-create-WSZTBKMS.js} +3 -3
- package/dist/{tax-region-tax-override-edit-2UZSGMS2.js → tax-region-tax-override-edit-OE4WUDOA.js} +3 -3
- package/dist/{user-metadata-4FOEUIG2.js → user-metadata-376YJMY3.js} +1 -1
- package/package.json +3 -3
- package/dist/chunk-TLE6YHGH.js +0 -26
|
@@ -20,9 +20,15 @@ import {
|
|
|
20
20
|
_DataTable,
|
|
21
21
|
useDataTable
|
|
22
22
|
} from "./chunk-ULJ3OMWU.js";
|
|
23
|
+
import {
|
|
24
|
+
NoRecords
|
|
25
|
+
} from "./chunk-3EF54XFY.js";
|
|
23
26
|
import {
|
|
24
27
|
currencies
|
|
25
28
|
} from "./chunk-IQPN4PZJ.js";
|
|
29
|
+
import {
|
|
30
|
+
DataTableStatusCell
|
|
31
|
+
} from "./chunk-MDABSESI.js";
|
|
26
32
|
import {
|
|
27
33
|
TwoColumnPageSkeleton
|
|
28
34
|
} from "./chunk-INNFZYX2.js";
|
|
@@ -43,7 +49,7 @@ import {
|
|
|
43
49
|
} from "./chunk-3B6MTW5G.js";
|
|
44
50
|
import {
|
|
45
51
|
useProductTableFilters
|
|
46
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-LNAXUDW2.js";
|
|
47
53
|
import {
|
|
48
54
|
useProductTableQuery
|
|
49
55
|
} from "./chunk-VVWB3GIK.js";
|
|
@@ -59,9 +65,8 @@ import {
|
|
|
59
65
|
useSellerInvites,
|
|
60
66
|
useSellerMembers,
|
|
61
67
|
useSellerProducts,
|
|
62
|
-
useSuspendSeller
|
|
63
|
-
|
|
64
|
-
} from "./chunk-2FLBJM53.js";
|
|
68
|
+
useSuspendSeller
|
|
69
|
+
} from "./chunk-LEG67A2R.js";
|
|
65
70
|
import {
|
|
66
71
|
useOrders
|
|
67
72
|
} from "./chunk-TAKEQAZZ.js";
|
|
@@ -82,13 +87,8 @@ import { useTranslation as useTranslation2 } from "react-i18next";
|
|
|
82
87
|
|
|
83
88
|
// src/pages/stores/store-details/components/store-detail-header.tsx
|
|
84
89
|
import { Children } from "react";
|
|
85
|
-
import {
|
|
86
|
-
|
|
87
|
-
PencilSquare,
|
|
88
|
-
Trash,
|
|
89
|
-
XCircleSolid
|
|
90
|
-
} from "@medusajs/icons";
|
|
91
|
-
import { Avatar, Heading, StatusBadge, Tooltip, toast, usePrompt } from "@medusajs/ui";
|
|
90
|
+
import { CheckCircleSolid, PencilSquare } from "@medusajs/icons";
|
|
91
|
+
import { Avatar, Heading, StatusBadge, Tooltip } from "@medusajs/ui";
|
|
92
92
|
import { useTranslation } from "react-i18next";
|
|
93
93
|
var import_types = __toESM(require_dist(), 1);
|
|
94
94
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -161,62 +161,6 @@ var StoreDetailActions = ({
|
|
|
161
161
|
children
|
|
162
162
|
}) => {
|
|
163
163
|
const { t } = useTranslation();
|
|
164
|
-
const prompt = usePrompt();
|
|
165
|
-
const { mutateAsync: approveSeller } = useApproveSeller(seller.id);
|
|
166
|
-
const { mutateAsync: terminateSeller } = useTerminateSeller(seller.id);
|
|
167
|
-
const handleAction = async (action, label) => {
|
|
168
|
-
const res = await prompt({
|
|
169
|
-
title: label.title,
|
|
170
|
-
description: label.description,
|
|
171
|
-
verificationText: seller.email || seller.name || "",
|
|
172
|
-
confirmText: t("actions.confirm"),
|
|
173
|
-
cancelText: t("actions.cancel")
|
|
174
|
-
});
|
|
175
|
-
if (!res) return;
|
|
176
|
-
await action().then(
|
|
177
|
-
() => toast.success(label.success),
|
|
178
|
-
(error) => toast.error(error.message)
|
|
179
|
-
);
|
|
180
|
-
};
|
|
181
|
-
const deleteAction = {
|
|
182
|
-
label: t("stores.actions.delete.label"),
|
|
183
|
-
onClick: () => handleAction(() => terminateSeller(), {
|
|
184
|
-
title: t("stores.actions.delete.title"),
|
|
185
|
-
description: t("stores.actions.delete.description"),
|
|
186
|
-
success: t("stores.actions.delete.success")
|
|
187
|
-
}),
|
|
188
|
-
icon: /* @__PURE__ */ jsx(Trash, {})
|
|
189
|
-
};
|
|
190
|
-
const statusActions = (() => {
|
|
191
|
-
switch (seller.status) {
|
|
192
|
-
case import_types.SellerStatus.PENDING_APPROVAL:
|
|
193
|
-
return [
|
|
194
|
-
{
|
|
195
|
-
label: t("stores.actions.approve.label"),
|
|
196
|
-
onClick: () => handleAction(() => approveSeller(), {
|
|
197
|
-
title: t("stores.actions.approve.title"),
|
|
198
|
-
description: t("stores.actions.approve.description"),
|
|
199
|
-
success: t("stores.actions.approve.success")
|
|
200
|
-
}),
|
|
201
|
-
icon: /* @__PURE__ */ jsx(CheckCircleSolid, {})
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
label: t("stores.actions.reject.label"),
|
|
205
|
-
onClick: () => handleAction(() => terminateSeller(), {
|
|
206
|
-
title: t("stores.actions.reject.title"),
|
|
207
|
-
description: t("stores.actions.reject.description"),
|
|
208
|
-
success: t("stores.actions.reject.success")
|
|
209
|
-
}),
|
|
210
|
-
icon: /* @__PURE__ */ jsx(XCircleSolid, {})
|
|
211
|
-
}
|
|
212
|
-
];
|
|
213
|
-
case import_types.SellerStatus.OPEN:
|
|
214
|
-
case import_types.SellerStatus.SUSPENDED:
|
|
215
|
-
return [deleteAction];
|
|
216
|
-
default:
|
|
217
|
-
return [];
|
|
218
|
-
}
|
|
219
|
-
})();
|
|
220
164
|
return /* @__PURE__ */ jsx("div", { className: "flex items-center gap-x-2", children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
221
165
|
/* @__PURE__ */ jsx(StatusBadge, { color: getStatusColor(seller.status), children: getStatusLabel(seller.status, t) }),
|
|
222
166
|
/* @__PURE__ */ jsx(
|
|
@@ -231,9 +175,6 @@ var StoreDetailActions = ({
|
|
|
231
175
|
to: `/stores/${seller.id}/edit`
|
|
232
176
|
}
|
|
233
177
|
]
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
actions: statusActions
|
|
237
178
|
}
|
|
238
179
|
]
|
|
239
180
|
}
|
|
@@ -418,7 +359,8 @@ var StoreCompanyDetailsSection = ({
|
|
|
418
359
|
};
|
|
419
360
|
|
|
420
361
|
// src/pages/stores/store-details/components/store-configuration-section.tsx
|
|
421
|
-
import {
|
|
362
|
+
import { CalendarMini } from "@medusajs/icons";
|
|
363
|
+
import { Container as Container4, Heading as Heading4, Table } from "@medusajs/ui";
|
|
422
364
|
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
423
365
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
424
366
|
var StoreConfigurationSection = ({
|
|
@@ -431,22 +373,28 @@ var StoreConfigurationSection = ({
|
|
|
431
373
|
hasTimeOff ? /* @__PURE__ */ jsxs5(Table, { children: [
|
|
432
374
|
/* @__PURE__ */ jsx5(Table.Header, { children: /* @__PURE__ */ jsxs5(Table.Row, { children: [
|
|
433
375
|
/* @__PURE__ */ jsx5(Table.HeaderCell, { children: t("fields.startDate") }),
|
|
434
|
-
/* @__PURE__ */ jsx5(Table.HeaderCell, { children: t("fields.endDate") })
|
|
376
|
+
/* @__PURE__ */ jsx5(Table.HeaderCell, { children: t("fields.endDate") }),
|
|
377
|
+
/* @__PURE__ */ jsx5(Table.HeaderCell, { children: t("fields.note") })
|
|
435
378
|
] }) }),
|
|
436
379
|
/* @__PURE__ */ jsx5(Table.Body, { children: /* @__PURE__ */ jsxs5(Table.Row, { children: [
|
|
437
380
|
/* @__PURE__ */ jsx5(Table.Cell, { children: /* @__PURE__ */ jsx5(DateCell, { date: seller.closed_from ?? null }) }),
|
|
438
|
-
/* @__PURE__ */ jsx5(Table.Cell, { children: /* @__PURE__ */ jsx5(DateCell, { date: seller.closed_to ?? null }) })
|
|
381
|
+
/* @__PURE__ */ jsx5(Table.Cell, { children: /* @__PURE__ */ jsx5(DateCell, { date: seller.closed_to ?? null }) }),
|
|
382
|
+
/* @__PURE__ */ jsx5(Table.Cell, { children: /* @__PURE__ */ jsx5("span", { className: "text-ui-fg-base", children: seller.closure_note || "-" }) })
|
|
439
383
|
] }) })
|
|
440
|
-
] }) : /* @__PURE__ */
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
384
|
+
] }) : /* @__PURE__ */ jsx5(
|
|
385
|
+
NoRecords,
|
|
386
|
+
{
|
|
387
|
+
icon: /* @__PURE__ */ jsx5(CalendarMini, { className: "text-ui-fg-subtle" }),
|
|
388
|
+
title: t("store.timeOff.empty.title"),
|
|
389
|
+
message: t("store.timeOff.empty.message")
|
|
390
|
+
}
|
|
391
|
+
)
|
|
444
392
|
] });
|
|
445
393
|
};
|
|
446
394
|
|
|
447
395
|
// src/pages/stores/store-details/components/store-address-section.tsx
|
|
448
396
|
import { BuildingStorefront, PencilSquare as PencilSquare4 } from "@medusajs/icons";
|
|
449
|
-
import { Container as Container5, Heading as Heading5, Text as
|
|
397
|
+
import { Container as Container5, Heading as Heading5, Text as Text4 } from "@medusajs/ui";
|
|
450
398
|
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
451
399
|
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
452
400
|
var StoreAddressSection = ({ seller }) => {
|
|
@@ -485,9 +433,9 @@ var StoreAddressSection = ({ seller }) => {
|
|
|
485
433
|
formattedAddress ? /* @__PURE__ */ jsx6("div", { className: "flex flex-col gap-2 px-2 pb-2", children: /* @__PURE__ */ jsx6("div", { className: "px-4 pb-2", children: /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-4", children: [
|
|
486
434
|
/* @__PURE__ */ jsx6(IconAvatar, { size: "large", variant: "squared", children: /* @__PURE__ */ jsx6(BuildingStorefront, {}) }),
|
|
487
435
|
/* @__PURE__ */ jsxs6("div", { className: "flex flex-1 flex-col", children: [
|
|
488
|
-
/* @__PURE__ */ jsx6(
|
|
436
|
+
/* @__PURE__ */ jsx6(Text4, { size: "small", leading: "compact", weight: "plus", children: address?.name || t("store.address.defaultName") }),
|
|
489
437
|
/* @__PURE__ */ jsx6(
|
|
490
|
-
|
|
438
|
+
Text4,
|
|
491
439
|
{
|
|
492
440
|
size: "small",
|
|
493
441
|
leading: "compact",
|
|
@@ -497,15 +445,15 @@ var StoreAddressSection = ({ seller }) => {
|
|
|
497
445
|
)
|
|
498
446
|
] })
|
|
499
447
|
] }) }) }) : /* @__PURE__ */ jsxs6("div", { className: "flex flex-col items-center gap-y-1 pb-6 pt-2", children: [
|
|
500
|
-
/* @__PURE__ */ jsx6(
|
|
501
|
-
/* @__PURE__ */ jsx6(
|
|
448
|
+
/* @__PURE__ */ jsx6(Text4, { size: "small", leading: "compact", weight: "plus", children: t("store.address.empty.title") }),
|
|
449
|
+
/* @__PURE__ */ jsx6(Text4, { size: "small", className: "text-ui-fg-muted", children: t("store.address.empty.message") })
|
|
502
450
|
] })
|
|
503
451
|
] });
|
|
504
452
|
};
|
|
505
453
|
|
|
506
454
|
// src/pages/stores/store-details/components/store-subscription-section.tsx
|
|
507
455
|
import { CurrencyDollar, TriangleRightMini } from "@medusajs/icons";
|
|
508
|
-
import { Container as Container6, Heading as Heading6, Text as
|
|
456
|
+
import { Container as Container6, Heading as Heading6, Text as Text5 } from "@medusajs/ui";
|
|
509
457
|
import { useTranslation as useTranslation7 } from "react-i18next";
|
|
510
458
|
import { Link } from "react-router-dom";
|
|
511
459
|
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
@@ -538,9 +486,9 @@ var StoreSubscriptionSection = ({
|
|
|
538
486
|
children: /* @__PURE__ */ jsx7("div", { className: "shadow-elevation-card-rest bg-ui-bg-component rounded-md px-4 py-2 transition-colors", children: /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-4", children: [
|
|
539
487
|
/* @__PURE__ */ jsx7(IconAvatar, { size: "large", variant: "squared", children: /* @__PURE__ */ jsx7(CurrencyDollar, {}) }),
|
|
540
488
|
/* @__PURE__ */ jsxs7("div", { className: "flex flex-1 flex-col", children: [
|
|
541
|
-
/* @__PURE__ */ jsx7(
|
|
489
|
+
/* @__PURE__ */ jsx7(Text5, { size: "small", leading: "compact", weight: "plus", children: plan.currency_code.toUpperCase() }),
|
|
542
490
|
/* @__PURE__ */ jsxs7(
|
|
543
|
-
|
|
491
|
+
Text5,
|
|
544
492
|
{
|
|
545
493
|
size: "small",
|
|
546
494
|
leading: "compact",
|
|
@@ -567,8 +515,8 @@ import { Link as Link2 } from "react-router-dom";
|
|
|
567
515
|
|
|
568
516
|
// src/pages/stores/store-details/components/store-members-section/store-members-data-table.tsx
|
|
569
517
|
import { useMemo } from "react";
|
|
570
|
-
import { ArrowPath, Link as LinkIcon, Trash
|
|
571
|
-
import {
|
|
518
|
+
import { ArrowPath, Link as LinkIcon, Trash } from "@medusajs/icons";
|
|
519
|
+
import { toast } from "@medusajs/ui";
|
|
572
520
|
import { keepPreviousData } from "@tanstack/react-query";
|
|
573
521
|
import { createColumnHelper } from "@tanstack/react-table";
|
|
574
522
|
import { useTranslation as useTranslation8 } from "react-i18next";
|
|
@@ -604,7 +552,7 @@ var StoreMembersDataTable = ({
|
|
|
604
552
|
id: m.id,
|
|
605
553
|
email: m.member?.email ?? "-",
|
|
606
554
|
role_id: m.role_id,
|
|
607
|
-
|
|
555
|
+
is_owner: Boolean(m.is_owner),
|
|
608
556
|
member: m
|
|
609
557
|
}));
|
|
610
558
|
const invites = (member_invites ?? []).filter((invite) => !invite.accepted).map((invite) => ({
|
|
@@ -612,7 +560,6 @@ var StoreMembersDataTable = ({
|
|
|
612
560
|
id: invite.id,
|
|
613
561
|
email: invite.email,
|
|
614
562
|
role_id: invite.role_id,
|
|
615
|
-
created_at: invite.created_at ?? null,
|
|
616
563
|
invite_url: invite.invite_url ?? null
|
|
617
564
|
}));
|
|
618
565
|
return [...invites, ...members];
|
|
@@ -644,7 +591,11 @@ var StoreMembersDataTable = ({
|
|
|
644
591
|
{ key: "updated_at", label: t("fields.updatedAt") }
|
|
645
592
|
],
|
|
646
593
|
noRecords: {
|
|
647
|
-
|
|
594
|
+
title: t("stores.emptyStates.users.title", "No users yet"),
|
|
595
|
+
message: t(
|
|
596
|
+
"stores.emptyStates.users.message",
|
|
597
|
+
"Invite the first user to manage this store."
|
|
598
|
+
)
|
|
648
599
|
}
|
|
649
600
|
}
|
|
650
601
|
);
|
|
@@ -672,22 +623,14 @@ var useColumns = (sellerId) => {
|
|
|
672
623
|
header: () => /* @__PURE__ */ jsx8("div", { className: "flex h-full w-full items-center", children: /* @__PURE__ */ jsx8("span", { children: t("fields.status") }) }),
|
|
673
624
|
cell: ({ row }) => {
|
|
674
625
|
const isPending = row.original.kind === "invite";
|
|
675
|
-
return /* @__PURE__ */ jsx8(
|
|
676
|
-
}
|
|
677
|
-
}),
|
|
678
|
-
columnHelper.accessor("created_at", {
|
|
679
|
-
header: () => /* @__PURE__ */ jsx8("div", { className: "flex h-full w-full items-center", children: /* @__PURE__ */ jsx8("span", { children: t("fields.createdAt") }) }),
|
|
680
|
-
cell: ({ getValue }) => {
|
|
681
|
-
const date = getValue();
|
|
682
|
-
return /* @__PURE__ */ jsx8(DateCell, { date: date ? new Date(date) : null });
|
|
626
|
+
return /* @__PURE__ */ jsx8(DataTableStatusCell, { color: isPending ? "orange" : "green", children: isPending ? t("users.status.pending") : t("users.status.active") });
|
|
683
627
|
}
|
|
684
628
|
}),
|
|
685
629
|
columnHelper.display({
|
|
686
630
|
id: "actions",
|
|
687
631
|
cell: ({ row }) => {
|
|
688
|
-
const isAdminRole = row.original.role_id === import_types2.SellerRole.SELLER_ADMINISTRATION;
|
|
689
632
|
if (row.original.kind === "member") {
|
|
690
|
-
if (
|
|
633
|
+
if (row.original.is_owner) return null;
|
|
691
634
|
return /* @__PURE__ */ jsx8(
|
|
692
635
|
MemberActions,
|
|
693
636
|
{
|
|
@@ -696,14 +639,7 @@ var useColumns = (sellerId) => {
|
|
|
696
639
|
}
|
|
697
640
|
);
|
|
698
641
|
}
|
|
699
|
-
return /* @__PURE__ */ jsx8(
|
|
700
|
-
InviteActions,
|
|
701
|
-
{
|
|
702
|
-
invite: row.original,
|
|
703
|
-
sellerId,
|
|
704
|
-
allowDelete: !isAdminRole
|
|
705
|
-
}
|
|
706
|
-
);
|
|
642
|
+
return /* @__PURE__ */ jsx8(InviteActions, { invite: row.original, sellerId });
|
|
707
643
|
}
|
|
708
644
|
})
|
|
709
645
|
],
|
|
@@ -712,8 +648,7 @@ var useColumns = (sellerId) => {
|
|
|
712
648
|
};
|
|
713
649
|
var InviteActions = ({
|
|
714
650
|
invite,
|
|
715
|
-
sellerId
|
|
716
|
-
allowDelete = true
|
|
651
|
+
sellerId
|
|
717
652
|
}) => {
|
|
718
653
|
const { t } = useTranslation8();
|
|
719
654
|
const { mutateAsync: resend } = useResendSellerInvite(sellerId);
|
|
@@ -721,11 +656,11 @@ var InviteActions = ({
|
|
|
721
656
|
const handleResend = async () => {
|
|
722
657
|
try {
|
|
723
658
|
await resend({ invite_id: invite.id });
|
|
724
|
-
|
|
659
|
+
toast.success(
|
|
725
660
|
t("stores.members.invite.resendSuccess", { email: invite.email })
|
|
726
661
|
);
|
|
727
662
|
} catch (e) {
|
|
728
|
-
|
|
663
|
+
toast.error(e.message);
|
|
729
664
|
}
|
|
730
665
|
};
|
|
731
666
|
const handleCopyLink = async () => {
|
|
@@ -736,23 +671,23 @@ var InviteActions = ({
|
|
|
736
671
|
url = response?.member_invite?.invite_url ?? null;
|
|
737
672
|
}
|
|
738
673
|
if (!url) {
|
|
739
|
-
|
|
674
|
+
toast.error(t("stores.members.invite.noVendorUrl"));
|
|
740
675
|
return;
|
|
741
676
|
}
|
|
742
677
|
await navigator.clipboard.writeText(url);
|
|
743
|
-
|
|
678
|
+
toast.success(t("stores.members.invite.linkCopied"));
|
|
744
679
|
} catch (e) {
|
|
745
|
-
|
|
680
|
+
toast.error(e.message);
|
|
746
681
|
}
|
|
747
682
|
};
|
|
748
683
|
const handleDelete = async () => {
|
|
749
684
|
try {
|
|
750
685
|
await deleteInvite({ invite_id: invite.id });
|
|
751
|
-
|
|
686
|
+
toast.success(
|
|
752
687
|
t("stores.members.invite.deleteSuccess", { email: invite.email })
|
|
753
688
|
);
|
|
754
689
|
} catch (e) {
|
|
755
|
-
|
|
690
|
+
toast.error(e.message);
|
|
756
691
|
}
|
|
757
692
|
};
|
|
758
693
|
const groups = [
|
|
@@ -769,19 +704,17 @@ var InviteActions = ({
|
|
|
769
704
|
onClick: handleCopyLink
|
|
770
705
|
}
|
|
771
706
|
]
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
if (allowDelete) {
|
|
775
|
-
groups.push({
|
|
707
|
+
},
|
|
708
|
+
{
|
|
776
709
|
actions: [
|
|
777
710
|
{
|
|
778
|
-
icon: /* @__PURE__ */ jsx8(
|
|
711
|
+
icon: /* @__PURE__ */ jsx8(Trash, {}),
|
|
779
712
|
label: t("actions.delete"),
|
|
780
713
|
onClick: handleDelete
|
|
781
714
|
}
|
|
782
715
|
]
|
|
783
|
-
}
|
|
784
|
-
|
|
716
|
+
}
|
|
717
|
+
];
|
|
785
718
|
return /* @__PURE__ */ jsx8(ActionMenu, { groups });
|
|
786
719
|
};
|
|
787
720
|
var MemberActions = ({
|
|
@@ -796,13 +729,13 @@ var MemberActions = ({
|
|
|
796
729
|
const handleRemove = async () => {
|
|
797
730
|
try {
|
|
798
731
|
await removeMember();
|
|
799
|
-
|
|
732
|
+
toast.success(
|
|
800
733
|
t("users.deleteUserSuccess", {
|
|
801
734
|
name: member.member?.email
|
|
802
735
|
})
|
|
803
736
|
);
|
|
804
737
|
} catch (e) {
|
|
805
|
-
|
|
738
|
+
toast.error(e.message);
|
|
806
739
|
}
|
|
807
740
|
};
|
|
808
741
|
return /* @__PURE__ */ jsx8(
|
|
@@ -812,7 +745,7 @@ var MemberActions = ({
|
|
|
812
745
|
{
|
|
813
746
|
actions: [
|
|
814
747
|
{
|
|
815
|
-
icon: /* @__PURE__ */ jsx8(
|
|
748
|
+
icon: /* @__PURE__ */ jsx8(Trash, {}),
|
|
816
749
|
label: t("actions.remove"),
|
|
817
750
|
onClick: handleRemove
|
|
818
751
|
}
|
|
@@ -830,7 +763,7 @@ var StoreMembersSection = ({ sellerId }) => {
|
|
|
830
763
|
return /* @__PURE__ */ jsxs8(Container7, { className: "divide-y p-0", children: [
|
|
831
764
|
/* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
832
765
|
/* @__PURE__ */ jsx9(Heading7, { level: "h2", children: t("users.domain", "Users") }),
|
|
833
|
-
/* @__PURE__ */ jsx9(Link2, { to: "invite", children: /* @__PURE__ */ jsx9(Button, { size: "small", variant: "secondary", children: t("
|
|
766
|
+
/* @__PURE__ */ jsx9(Link2, { to: "invite", children: /* @__PURE__ */ jsx9(Button, { size: "small", variant: "secondary", children: t("stores.members.addUser.action", "Add") }) })
|
|
834
767
|
] }),
|
|
835
768
|
/* @__PURE__ */ jsx9(StoreMembersDataTable, { sellerId })
|
|
836
769
|
] });
|
|
@@ -843,96 +776,134 @@ import {
|
|
|
843
776
|
Button as Button2,
|
|
844
777
|
Container as Container8,
|
|
845
778
|
Heading as Heading8,
|
|
846
|
-
|
|
779
|
+
Prompt,
|
|
780
|
+
Text as Text6,
|
|
847
781
|
Textarea,
|
|
848
|
-
toast as
|
|
782
|
+
toast as toast2
|
|
849
783
|
} from "@medusajs/ui";
|
|
850
784
|
import { useTranslation as useTranslation10 } from "react-i18next";
|
|
851
|
-
import {
|
|
785
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
852
786
|
var StoreRequestSection = ({ seller }) => {
|
|
853
787
|
const { t } = useTranslation10();
|
|
854
|
-
const [pendingAction, setPendingAction] = useState(null);
|
|
855
|
-
const [note, setNote] = useState("");
|
|
856
788
|
const { mutateAsync: approveSeller, isPending: isApproving } = useApproveSeller(seller.id);
|
|
857
789
|
const { mutateAsync: suspendSeller, isPending: isRejecting } = useSuspendSeller(seller.id);
|
|
858
790
|
const requesterLabel = seller.email || seller.name;
|
|
859
|
-
const cancel = () => {
|
|
860
|
-
setPendingAction(null);
|
|
861
|
-
setNote("");
|
|
862
|
-
};
|
|
863
|
-
const submit = async () => {
|
|
864
|
-
try {
|
|
865
|
-
if (pendingAction === "confirm") {
|
|
866
|
-
await approveSeller();
|
|
867
|
-
toast3.success(t("stores.request.confirmSuccess"));
|
|
868
|
-
} else if (pendingAction === "reject") {
|
|
869
|
-
await suspendSeller({ reason: note || void 0 });
|
|
870
|
-
toast3.success(t("stores.request.rejectSuccess"));
|
|
871
|
-
}
|
|
872
|
-
cancel();
|
|
873
|
-
} catch (error) {
|
|
874
|
-
toast3.error(error.message);
|
|
875
|
-
}
|
|
876
|
-
};
|
|
877
|
-
const isSubmitting = isApproving || isRejecting;
|
|
878
791
|
return /* @__PURE__ */ jsxs9(Container8, { className: "p-0", children: [
|
|
879
792
|
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-x-3 border-b border-ui-border-base px-6 py-4", children: [
|
|
880
793
|
/* @__PURE__ */ jsx10(ExclamationCircleSolid, { className: "text-ui-tag-blue-icon" }),
|
|
881
794
|
/* @__PURE__ */ jsx10(Heading8, { level: "h2", children: t("stores.request.title") })
|
|
882
795
|
] }),
|
|
883
|
-
/* @__PURE__ */ jsx10("div", { className: "px-6 py-4", children: /* @__PURE__ */ jsx10(
|
|
884
|
-
|
|
885
|
-
/* @__PURE__ */ jsx10(Text7, { size: "small", weight: "plus", className: "text-ui-fg-subtle", children: pendingAction === "confirm" ? t("stores.request.confirmNoteLabel") : t("stores.request.rejectNoteLabel") }),
|
|
796
|
+
/* @__PURE__ */ jsx10("div", { className: "px-6 py-4", children: /* @__PURE__ */ jsx10(Text6, { className: "text-ui-fg-subtle", children: t("stores.request.description", { requester: requesterLabel }) }) }),
|
|
797
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-end gap-x-2 rounded-b-lg border-t border-ui-border-base bg-ui-bg-subtle px-6 py-4", children: [
|
|
886
798
|
/* @__PURE__ */ jsx10(
|
|
887
|
-
|
|
799
|
+
RequestActionPrompt,
|
|
888
800
|
{
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
Button2,
|
|
908
|
-
{
|
|
909
|
-
size: "small",
|
|
910
|
-
variant: pendingAction === "reject" ? "danger" : "primary",
|
|
911
|
-
onClick: submit,
|
|
912
|
-
isLoading: isSubmitting,
|
|
913
|
-
children: pendingAction === "confirm" ? t("stores.request.confirm") : t("stores.request.reject")
|
|
914
|
-
}
|
|
915
|
-
)
|
|
916
|
-
] }) : /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
917
|
-
/* @__PURE__ */ jsx10(
|
|
918
|
-
Button2,
|
|
919
|
-
{
|
|
920
|
-
size: "small",
|
|
921
|
-
variant: "secondary",
|
|
922
|
-
onClick: () => setPendingAction("confirm"),
|
|
923
|
-
children: t("stores.request.confirm")
|
|
801
|
+
trigger: /* @__PURE__ */ jsx10(Button2, { size: "small", variant: "secondary", children: t("stores.request.reject") }),
|
|
802
|
+
title: t("stores.request.rejectTitle", "Reject store request"),
|
|
803
|
+
description: t(
|
|
804
|
+
"stores.request.rejectDescription",
|
|
805
|
+
"Provide an optional reason. The vendor will be notified."
|
|
806
|
+
),
|
|
807
|
+
confirmLabel: t("stores.request.reject"),
|
|
808
|
+
confirmVariant: "danger",
|
|
809
|
+
isLoading: isRejecting,
|
|
810
|
+
onConfirm: async (note) => {
|
|
811
|
+
try {
|
|
812
|
+
await suspendSeller({ reason: note || void 0 });
|
|
813
|
+
toast2.success(t("stores.request.rejectSuccess"));
|
|
814
|
+
} catch (error) {
|
|
815
|
+
toast2.error(error.message);
|
|
816
|
+
throw error;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
924
819
|
}
|
|
925
820
|
),
|
|
926
821
|
/* @__PURE__ */ jsx10(
|
|
927
|
-
|
|
822
|
+
RequestActionPrompt,
|
|
928
823
|
{
|
|
929
|
-
size: "small",
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
824
|
+
trigger: /* @__PURE__ */ jsx10(Button2, { size: "small", variant: "primary", children: t("stores.request.confirm") }),
|
|
825
|
+
title: t("stores.request.confirmTitle", "Approve store request"),
|
|
826
|
+
description: t(
|
|
827
|
+
"stores.request.confirmDescription",
|
|
828
|
+
"Provide an optional note for the vendor."
|
|
829
|
+
),
|
|
830
|
+
confirmLabel: t("stores.request.confirm"),
|
|
831
|
+
confirmVariant: "primary",
|
|
832
|
+
isLoading: isApproving,
|
|
833
|
+
onConfirm: async (_note) => {
|
|
834
|
+
try {
|
|
835
|
+
await approveSeller();
|
|
836
|
+
toast2.success(t("stores.request.confirmSuccess"));
|
|
837
|
+
} catch (error) {
|
|
838
|
+
toast2.error(error.message);
|
|
839
|
+
throw error;
|
|
840
|
+
}
|
|
841
|
+
}
|
|
933
842
|
}
|
|
934
843
|
)
|
|
935
|
-
] })
|
|
844
|
+
] })
|
|
845
|
+
] });
|
|
846
|
+
};
|
|
847
|
+
var RequestActionPrompt = ({
|
|
848
|
+
trigger,
|
|
849
|
+
title,
|
|
850
|
+
description,
|
|
851
|
+
confirmLabel,
|
|
852
|
+
confirmVariant,
|
|
853
|
+
isLoading,
|
|
854
|
+
onConfirm
|
|
855
|
+
}) => {
|
|
856
|
+
const { t } = useTranslation10();
|
|
857
|
+
const [open, setOpen] = useState(false);
|
|
858
|
+
const [note, setNote] = useState("");
|
|
859
|
+
const handleSubmit = async () => {
|
|
860
|
+
try {
|
|
861
|
+
await onConfirm(note);
|
|
862
|
+
setOpen(false);
|
|
863
|
+
setNote("");
|
|
864
|
+
} catch {
|
|
865
|
+
}
|
|
866
|
+
};
|
|
867
|
+
return /* @__PURE__ */ jsxs9(Prompt, { open, onOpenChange: setOpen, variant: confirmVariant, children: [
|
|
868
|
+
/* @__PURE__ */ jsx10(Prompt.Trigger, { asChild: true, children: trigger }),
|
|
869
|
+
/* @__PURE__ */ jsxs9(Prompt.Content, { children: [
|
|
870
|
+
/* @__PURE__ */ jsxs9(Prompt.Header, { children: [
|
|
871
|
+
/* @__PURE__ */ jsx10(Prompt.Title, { children: title }),
|
|
872
|
+
/* @__PURE__ */ jsx10(Prompt.Description, { children: description })
|
|
873
|
+
] }),
|
|
874
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-col gap-y-2 px-6 pb-4", children: [
|
|
875
|
+
/* @__PURE__ */ jsxs9(Text6, { size: "small", weight: "plus", className: "text-ui-fg-subtle", children: [
|
|
876
|
+
t("stores.request.noteLabel", "Note"),
|
|
877
|
+
" ",
|
|
878
|
+
/* @__PURE__ */ jsxs9("span", { className: "text-ui-fg-muted font-normal", children: [
|
|
879
|
+
"(",
|
|
880
|
+
t("fields.optional", "Optional"),
|
|
881
|
+
")"
|
|
882
|
+
] })
|
|
883
|
+
] }),
|
|
884
|
+
/* @__PURE__ */ jsx10(
|
|
885
|
+
Textarea,
|
|
886
|
+
{
|
|
887
|
+
placeholder: t("stores.request.notePlaceholder"),
|
|
888
|
+
value: note,
|
|
889
|
+
onChange: (e) => setNote(e.target.value)
|
|
890
|
+
}
|
|
891
|
+
)
|
|
892
|
+
] }),
|
|
893
|
+
/* @__PURE__ */ jsxs9(Prompt.Footer, { children: [
|
|
894
|
+
/* @__PURE__ */ jsx10(Prompt.Cancel, { disabled: isLoading, children: t("actions.cancel") }),
|
|
895
|
+
/* @__PURE__ */ jsx10(
|
|
896
|
+
Button2,
|
|
897
|
+
{
|
|
898
|
+
size: "small",
|
|
899
|
+
variant: confirmVariant === "danger" ? "danger" : "primary",
|
|
900
|
+
onClick: handleSubmit,
|
|
901
|
+
isLoading,
|
|
902
|
+
children: confirmLabel
|
|
903
|
+
}
|
|
904
|
+
)
|
|
905
|
+
] })
|
|
906
|
+
] })
|
|
936
907
|
] });
|
|
937
908
|
};
|
|
938
909
|
|
|
@@ -1005,7 +976,11 @@ var StoreOrdersSection = ({ sellerId }) => {
|
|
|
1005
976
|
queryObject: raw,
|
|
1006
977
|
prefix: PREFIX,
|
|
1007
978
|
noRecords: {
|
|
1008
|
-
|
|
979
|
+
title: t("stores.emptyStates.orders.title", "No orders yet"),
|
|
980
|
+
message: t(
|
|
981
|
+
"stores.emptyStates.orders.message",
|
|
982
|
+
"Orders placed at this store will appear here."
|
|
983
|
+
)
|
|
1009
984
|
}
|
|
1010
985
|
}
|
|
1011
986
|
)
|
|
@@ -1076,7 +1051,11 @@ var StoreProductsSection = ({
|
|
|
1076
1051
|
pagination: true,
|
|
1077
1052
|
prefix: PREFIX2,
|
|
1078
1053
|
noRecords: {
|
|
1079
|
-
|
|
1054
|
+
title: t("stores.emptyStates.products.title", "No products yet"),
|
|
1055
|
+
message: t(
|
|
1056
|
+
"stores.emptyStates.products.message",
|
|
1057
|
+
"Products published by this store will appear here."
|
|
1058
|
+
)
|
|
1080
1059
|
}
|
|
1081
1060
|
}
|
|
1082
1061
|
)
|
|
@@ -1140,7 +1119,7 @@ var Root = ({ children }) => {
|
|
|
1140
1119
|
}
|
|
1141
1120
|
return /* @__PURE__ */ jsxs12(TwoColumnPage, { data: seller, hasOutlet: true, "data-testid": "store-detail-page", children: [
|
|
1142
1121
|
/* @__PURE__ */ jsxs12(TwoColumnPage.Main, { children: [
|
|
1143
|
-
seller.status === import_types3.SellerStatus.PENDING_APPROVAL && /* @__PURE__ */ jsx13(StoreRequestSection, { seller }),
|
|
1122
|
+
seller.status === import_types3.SellerStatus.PENDING_APPROVAL && !seller.approved_at && /* @__PURE__ */ jsx13(StoreRequestSection, { seller }),
|
|
1144
1123
|
/* @__PURE__ */ jsx13(StoreGeneralSection, { seller }),
|
|
1145
1124
|
/* @__PURE__ */ jsx13(TabBar, { activeTab, onTabChange: setActiveTab }),
|
|
1146
1125
|
activeTab === "orders" && /* @__PURE__ */ jsx13(
|