sme-pos-package 1.0.13 → 1.0.15
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/index.d.mts +1 -1
- package/dist/index.mjs +1 -0
- package/package.json +4 -1
- package/dist/index.css.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/tailwind.preset.mjs.map +0 -1
- package/public/assets/images/bank-logos.png +0 -0
- package/public/assets/images/banner1.png +0 -0
- package/public/assets/images/banner2.png +0 -0
- package/public/assets/images/banner3.png +0 -0
- package/public/assets/images/banner4.png +0 -0
- package/public/assets/images/cashier.svg +0 -9
- package/public/assets/images/empty-cart.png +0 -0
- package/public/assets/images/empty-table-state.png +0 -0
- package/public/assets/images/layout-display/left-layout.png +0 -0
- package/public/assets/images/layout-display/right-layout.png +0 -0
- package/public/assets/images/modal-illustration.png +0 -0
- package/public/assets/images/order-empty-state.png +0 -0
- package/public/assets/images/order.png +0 -0
- package/public/assets/images/payment-success-label.png +0 -0
- package/public/assets/images/table-empty.png +0 -0
- package/public/assets/images/take-away.png +0 -0
- package/public/assets/lottie/loading.json +0 -1
- package/public/assets/lottie/soft_pos.json +0 -1
- package/public/assets/lottie/success.json +0 -1
- package/public/config.json +0 -27
- package/public/env.json +0 -17
- package/src/animations/success.json +0 -9730
- package/src/assets/icons/breadcrumbs-icon.tsx +0 -85
- package/src/assets/icons/cart-icon.tsx +0 -14
- package/src/assets/icons/common.tsx +0 -270
- package/src/assets/icons/customer-view-icon.tsx +0 -20
- package/src/assets/icons/dining-table.tsx +0 -34
- package/src/assets/icons/edit-line-icon.tsx +0 -18
- package/src/assets/icons/emenu-icon.tsx +0 -39
- package/src/assets/icons/file-close-line-icon.tsx +0 -18
- package/src/assets/icons/helper-icon.tsx +0 -84
- package/src/assets/icons/home-gear-line-icon.tsx +0 -18
- package/src/assets/icons/kanban-icon.tsx +0 -16
- package/src/assets/icons/loading-icon.tsx +0 -45
- package/src/assets/icons/logout-box-line-icon.tsx +0 -18
- package/src/assets/icons/order-icon.tsx +0 -92
- package/src/assets/icons/payment-icon.tsx +0 -429
- package/src/assets/icons/pincode.tsx +0 -196
- package/src/assets/icons/pos-connect-icon.tsx +0 -67
- package/src/assets/icons/pos-device-icon.tsx +0 -52
- package/src/assets/icons/pos-icon.tsx +0 -75
- package/src/assets/icons/printer-line-icon.tsx +0 -18
- package/src/assets/icons/star-icon.tsx +0 -174
- package/src/assets/icons/table-icon.tsx +0 -77
- package/src/assets/icons/user-add-line-icon.tsx +0 -33
- package/src/assets/icons/user-icon.tsx +0 -65
- package/src/components/common/button-action.tsx +0 -46
- package/src/components/common/button-icon.tsx +0 -23
- package/src/components/common/dropdown/index.tsx +0 -79
- package/src/components/common/empty-state.tsx +0 -60
- package/src/components/common/header/index.tsx +0 -89
- package/src/components/common/header/tabs.tsx +0 -119
- package/src/components/common/image.tsx +0 -20
- package/src/components/common/input/index.tsx +0 -55
- package/src/components/common/input/radio-group.tsx +0 -75
- package/src/components/common/input/text-area.tsx +0 -28
- package/src/components/common/modal/delete-confirm-modal-container.tsx +0 -65
- package/src/components/common/modal/index.ts +0 -2
- package/src/components/common/modal/modal-direction.tsx +0 -125
- package/src/components/common/modal/modal-header.tsx +0 -37
- package/src/components/common/modal/modal-wrapper.tsx +0 -56
- package/src/components/common/modal/modal-zoom.tsx +0 -61
- package/src/components/common/pagination.tsx +0 -95
- package/src/components/common/refresh-button.tsx +0 -28
- package/src/components/common/search-bar.tsx +0 -27
- package/src/components/common/search.tsx +0 -59
- package/src/components/common/skeleton.tsx +0 -7
- package/src/components/common/tabs-layout.tsx +0 -98
- package/src/components/common/use-check-session.tsx +0 -19
- package/src/components/customer-management/add-customer/add-customer-drawer.tsx +0 -286
- package/src/components/customer-management/add-customer/address-select.tsx +0 -51
- package/src/components/customer-management/choose-customer-drawer.tsx +0 -177
- package/src/components/customer-management/customer-info-drawer.tsx +0 -166
- package/src/components/customer-management/customer-no-data.tsx +0 -18
- package/src/components/emenu/emenu-qr-code.tsx +0 -59
- package/src/components/emenu/menu-link.tsx +0 -67
- package/src/components/index.ts +0 -8
- package/src/components/kanban-template/kitchen-template.tsx +0 -60
- package/src/components/kanban-template/pos-order-template.tsx +0 -77
- package/src/components/kanban-template/pos-template.tsx +0 -170
- package/src/components/kitchen-management/change-status-confirm-modal.tsx +0 -61
- package/src/components/kitchen-management/index.ts +0 -1
- package/src/components/kitchen-management/kitchen-order/index.tsx +0 -153
- package/src/components/kitchen-management/kitchen-order/line.tsx +0 -78
- package/src/components/kitchen-management/kitchen-order/state.tsx +0 -52
- package/src/components/kitchen-management/kitchen-status.tsx +0 -69
- package/src/components/kitchen-management/orders-kitchen-management.tsx +0 -113
- package/src/components/order-management/index.tsx +0 -128
- package/src/components/order-management/order-actions.tsx +0 -46
- package/src/components/order-management/order-detail/header.tsx +0 -37
- package/src/components/order-management/order-detail/index.ts +0 -3
- package/src/components/order-management/order-detail/information.tsx +0 -96
- package/src/components/order-management/order-detail/order-detail.tsx +0 -84
- package/src/components/order-management/order-detail/order-line.tsx +0 -56
- package/src/components/order-management/order-detail/summary.tsx +0 -221
- package/src/components/order-management/order-header.tsx +0 -113
- package/src/components/order-management/order-pagination.tsx +0 -49
- package/src/components/order-management/order-status.tsx +0 -58
- package/src/components/order-management/order-table.tsx +0 -179
- package/src/components/order-management/order-tabs.tsx +0 -48
- package/src/components/pos-management/add-product-from-barcode/index.tsx +0 -97
- package/src/components/pos-management/cart-content/action-line.tsx +0 -81
- package/src/components/pos-management/cart-content/cancel-order-line-modal.tsx +0 -41
- package/src/components/pos-management/cart-content/cart-item.tsx +0 -173
- package/src/components/pos-management/cart-content/cart-items.tsx +0 -130
- package/src/components/pos-management/cart-content/draft-orders/draft-order-line.tsx +0 -67
- package/src/components/pos-management/cart-content/draft-orders/index.tsx +0 -40
- package/src/components/pos-management/cart-content/edit-cart-modal.tsx +0 -11
- package/src/components/pos-management/cart-content/index.tsx +0 -260
- package/src/components/pos-management/cart-content/no-select-order.tsx +0 -26
- package/src/components/pos-management/cart-content/order-info/customer-info.tsx +0 -53
- package/src/components/pos-management/cart-content/order-info/index.tsx +0 -109
- package/src/components/pos-management/cart-content/order-total.tsx +0 -36
- package/src/components/pos-management/cart-content/orders-line.tsx +0 -72
- package/src/components/pos-management/menu-content/category-tab.tsx +0 -38
- package/src/components/pos-management/menu-content/create-order-modal.tsx +0 -65
- package/src/components/pos-management/menu-content/product-content.tsx +0 -93
- package/src/components/pos-management/menu-content/product-detail/info.tsx +0 -28
- package/src/components/pos-management/menu-content/product-detail/modal.tsx +0 -148
- package/src/components/pos-management/menu-content/product-detail/option.tsx +0 -87
- package/src/components/pos-management/menu-content/product-detail/quantity-control.tsx +0 -155
- package/src/components/pos-management/menu-content/product-detail/sale-keypad.tsx +0 -100
- package/src/components/pos-management/menu-content/product-item.tsx +0 -65
- package/src/components/pos-management/order-helper/cancel-order-confirm.tsx +0 -43
- package/src/components/pos-management/order-helper/history-call.tsx +0 -105
- package/src/components/pos-management/order-helper/order-helper-modal.tsx +0 -116
- package/src/components/pos-management/payment-content/bill/actions.tsx +0 -46
- package/src/components/pos-management/payment-content/bill/content.tsx +0 -207
- package/src/components/pos-management/payment-content/bill/index.tsx +0 -18
- package/src/components/pos-management/payment-content/card-payment/index.tsx +0 -124
- package/src/components/pos-management/payment-content/card-payment/pos-payment/pos-connect.tsx +0 -183
- package/src/components/pos-management/payment-content/card-payment/pos-payment/qr-connect.tsx +0 -185
- package/src/components/pos-management/payment-content/card-payment/waiting-for-payment-pos-modal.tsx +0 -37
- package/src/components/pos-management/payment-content/cash-payment/index.tsx +0 -216
- package/src/components/pos-management/payment-content/index.tsx +0 -70
- package/src/components/pos-management/payment-content/payment-info.tsx +0 -67
- package/src/components/pos-management/payment-content/payment-layout.tsx +0 -16
- package/src/components/pos-management/payment-content/payment-method-cards.tsx +0 -99
- package/src/components/pos-management/payment-content/qr-payment/index.tsx +0 -118
- package/src/components/pos-management/payment-content/qr-payment/qr_code.js +0 -29
- package/src/components/pos-management/payment-content/qr-payment/vietqr.js +0 -436
- package/src/components/pos-management/payment-content/session-close-modal.tsx +0 -35
- package/src/components/pos-management/payment-content/soft-pos-payment/index.tsx +0 -48
- package/src/components/pos-management/pos-helpers/back-confirm.tsx +0 -45
- package/src/components/pos-management/pos-helpers/index.tsx +0 -135
- package/src/components/pos-management/pos-helpers/layout-display-modal.tsx +0 -99
- package/src/components/pos-management/search.tsx +0 -48
- package/src/components/pos-management/table-content/filtered-tables.tsx +0 -59
- package/src/components/pos-management/table-content/floor-tabs.tsx +0 -65
- package/src/components/pos-management/table-content/index.tsx +0 -76
- package/src/components/pos-management/table-content/table-item.tsx +0 -127
- package/src/components/pos-management/table-content/tables.tsx +0 -96
- package/src/components/restaurant-management/add-floor-modal.tsx +0 -133
- package/src/components/restaurant-management/add-table-modal.tsx +0 -198
- package/src/components/restaurant-management/delete-floor-confirm-modal.tsx +0 -42
- package/src/components/restaurant-management/delete-table-confirm-modal.tsx +0 -51
- package/src/components/restaurant-management/header.tsx +0 -22
- package/src/components/restaurant-management/index.tsx +0 -54
- package/src/components/restaurant-management/left-side.tsx +0 -51
- package/src/components/restaurant-management/right-side.tsx +0 -179
- package/src/components/restaurant-management/table-empty.tsx +0 -43
- package/src/components/session-management/close-session-modal/actions.tsx +0 -45
- package/src/components/session-management/close-session-modal/close-session-confirm.tsx +0 -157
- package/src/components/session-management/close-session-modal/close-session-ticket.tsx +0 -218
- package/src/components/session-management/close-session-modal/container.tsx +0 -25
- package/src/components/session-management/close-session-modal/draft-orders-confirm.tsx +0 -53
- package/src/components/session-management/close-session-modal/draft-orders-summary.tsx +0 -82
- package/src/components/session-management/close-session-modal/draft-orders.tsx +0 -34
- package/src/components/session-management/close-session-modal/index.tsx +0 -35
- package/src/components/session-management/close-session-modal/order/index.ts +0 -1
- package/src/components/session-management/close-session-modal/order/order-line.tsx +0 -64
- package/src/components/session-management/close-session-modal/order/orders-in-draft.tsx +0 -31
- package/src/components/session-management/close-session-modal/session-summary.tsx +0 -165
- package/src/components/session-management/index.ts +0 -1
- package/src/components/session-management/open-shift/index.tsx +0 -172
- package/src/components/table-management/index.tsx +0 -0
- package/src/constants/api/index.ts +0 -1
- package/src/constants/headers.constant.tsx +0 -24
- package/src/constants/index.ts +0 -1
- package/src/constants/language.store.ts +0 -21
- package/src/constants/methods.constant.ts +0 -10
- package/src/constants/order-state.ts +0 -8
- package/src/constants/payment-color.constant.ts +0 -26
- package/src/constants/query.constant.ts +0 -14
- package/src/constants/routes.constants.ts +0 -23
- package/src/constants/template-name.constant.ts +0 -9
- package/src/hooks/bill/use-get-bill-information.ts +0 -49
- package/src/hooks/bill/use-print-bill.tsx +0 -0
- package/src/hooks/common/load-env-config.ts +0 -98
- package/src/hooks/common/use-back.ts +0 -13
- package/src/hooks/common/use-broadcast.ts +0 -22
- package/src/hooks/common/use-click-outside.ts +0 -58
- package/src/hooks/common/use-get-base64-photo.ts +0 -71
- package/src/hooks/common/use-get-query.ts +0 -25
- package/src/hooks/common/use-pos.ts +0 -21
- package/src/hooks/common/use-query-params.ts +0 -89
- package/src/hooks/common/use-speech.ts +0 -36
- package/src/hooks/customer/use-customer-provider.ts +0 -247
- package/src/hooks/floor/use-floor-provider.ts +0 -172
- package/src/hooks/kitchen/use-kitchen-provider.ts +0 -80
- package/src/hooks/order/use-get-point-reward.ts +0 -50
- package/src/hooks/order/use-loop-fetch-order.ts +0 -30
- package/src/hooks/order/use-order-items.ts +0 -61
- package/src/hooks/order/use-orders.ts +0 -76
- package/src/hooks/payment/use-payment-provider.ts +0 -221
- package/src/hooks/product/use-product-provider.ts +0 -87
- package/src/hooks/session/use-check-session.tsx +0 -19
- package/src/hooks/session/use-session-provider.ts +0 -79
- package/src/hooks/table/use-pos-table-provider.ts +0 -193
- package/src/index.css +0 -5
- package/src/index.ts +0 -10
- package/src/layouts/common.tsx +0 -15
- package/src/layouts/index.ts +0 -4
- package/src/layouts/pos-layout.tsx +0 -33
- package/src/layouts/pos-order-layout.tsx +0 -43
- package/src/layouts/sale-layout.tsx +0 -25
- package/src/locales/en.json +0 -394
- package/src/locales/vi.json +0 -400
- package/src/pages/index.ts +0 -4
- package/src/pages/login/index.tsx +0 -128
- package/src/pages/pincode/index.tsx +0 -198
- package/src/pages/pos/kitchen-management/layout.tsx +0 -18
- package/src/pages/pos/management-floor/index.tsx +0 -7
- package/src/pages/pos/management-order/index.tsx +0 -7
- package/src/pages/pos/management-order/order-detail/index.tsx +0 -7
- package/src/pages/pos/management-table/index.tsx +0 -0
- package/src/pages/pos/payment-success/index.tsx +0 -75
- package/src/provider/app-provider.tsx +0 -56
- package/src/provider/fallback/custom-error.tsx +0 -26
- package/src/provider/main-provider.tsx +0 -41
- package/src/provider/meta-provider.tsx +0 -72
- package/src/provider/modal-provider.tsx +0 -48
- package/src/provider/notification-provider.tsx +0 -64
- package/src/provider/pos-provider/close-session-provider/index.tsx +0 -207
- package/src/provider/pos-provider/customer-provider/index.tsx +0 -30
- package/src/provider/pos-provider/floor-provider/index.tsx +0 -39
- package/src/provider/pos-provider/index.ts +0 -6
- package/src/provider/pos-provider/kitchen-provider/index.tsx +0 -30
- package/src/provider/pos-provider/order-detail-provider/index.tsx +0 -233
- package/src/provider/pos-provider/order-provider/index.tsx +0 -803
- package/src/provider/pos-provider/payment-provider/index.tsx +0 -30
- package/src/provider/pos-provider/product-provider/index.tsx +0 -30
- package/src/provider/pos-provider/sale-provider/index.tsx +0 -168
- package/src/provider/pos-provider/session-provider/index.tsx +0 -30
- package/src/provider/pos-provider/socket-provider/index.tsx +0 -118
- package/src/provider/pos-provider/table-provider/index.tsx +0 -30
- package/src/provider/public-provider.tsx +0 -104
- package/src/provider/use-session-provider.ts +0 -79
- package/src/router/app-router.tsx +0 -38
- package/src/router/index.tsx +0 -26
- package/src/router/pos-route.tsx +0 -75
- package/src/router/protected-route.tsx +0 -16
- package/src/router/public-route.tsx +0 -11
- package/src/store/header/index.ts +0 -21
- package/src/store/session/index.ts +0 -25
- package/src/store/states/cart.state.ts +0 -135
- package/src/store/states/close-session.state.ts +0 -20
- package/src/store/states/customer.state.ts +0 -19
- package/src/store/states/payment.state.ts +0 -14
- package/src/styles/base.css +0 -212
- package/src/styles/common.css +0 -65
- package/src/styles/lib/tailwind.css +0 -0
- package/src/styles/lib/tailwind.theme.css +0 -34
- package/src/styles/loading.css +0 -72
- package/src/styles/main.css +0 -5
- package/src/styles/refreshing-content.css +0 -55
- package/src/styles/text.css +0 -44
- package/src/types/account.ts +0 -61
- package/src/types/branch.ts +0 -6
- package/src/types/category.ts +0 -13
- package/src/types/common.ts +0 -4
- package/src/types/customer.ts +0 -52
- package/src/types/dashboard.ts +0 -18
- package/src/types/edc.ts +0 -37
- package/src/types/export-e-invoice.ts +0 -17
- package/src/types/filter.d.ts +0 -12
- package/src/types/floor/floor.ts +0 -16
- package/src/types/floor.d.ts +0 -36
- package/src/types/index.ts +0 -127
- package/src/types/invoice.ts +0 -32
- package/src/types/modal.ts +0 -15
- package/src/types/notification.ts +0 -12
- package/src/types/order.ts +0 -182
- package/src/types/payment.ts +0 -44
- package/src/types/product/product.ts +0 -47
- package/src/types/product.ts +0 -137
- package/src/types/provider-info.d.ts +0 -14
- package/src/types/qr.d.ts +0 -25
- package/src/types/report.d.ts +0 -43
- package/src/types/sale.d.ts +0 -68
- package/src/types/search.d.ts +0 -7
- package/src/types/session.d.ts +0 -30
- package/src/types/shop-qr.d.ts +0 -89
- package/src/types/staff.d.ts +0 -35
- package/src/types/store.d.ts +0 -25
- package/src/types/table.d.ts +0 -57
- package/src/utils/close-session-ticket.tsx +0 -129
- package/src/utils/functions.ts +0 -299
- package/src/utils/i18n.ts +0 -25
- package/src/utils/pos/bill.ts +0 -156
- package/src/utils/pos/convert-order.ts +0 -58
- package/src/utils/pos/helpers.ts +0 -48
- package/src/utils/pos/session.ts +0 -44
- package/src/utils/storages/index.ts +0 -1
- package/src/utils/storages/local-storage.ts +0 -72
- package/tailwind.preset.ts +0 -25
- package/tsconfig.json +0 -30
- package/tsup.config.ts +0 -30
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { IcRefresh } from "@assets/icons/breadcrumbs-icon";
|
|
2
|
-
import { useQueryParams } from "@hooks/common/use-query-params";
|
|
3
|
-
import { cn } from "@utils/functions";
|
|
4
|
-
import { useEffect, useState } from "react";
|
|
5
|
-
import { ButtonIcon } from "./button-icon";
|
|
6
|
-
|
|
7
|
-
export type TTab = {
|
|
8
|
-
id: number | string;
|
|
9
|
-
name: string;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const TabsLayout = ({
|
|
13
|
-
tabs,
|
|
14
|
-
onClick,
|
|
15
|
-
queryKey,
|
|
16
|
-
className,
|
|
17
|
-
activeValue,
|
|
18
|
-
rightButton,
|
|
19
|
-
alwaysShowButton,
|
|
20
|
-
}: {
|
|
21
|
-
tabs: TTab[];
|
|
22
|
-
queryKey: string;
|
|
23
|
-
activeValue?: number | string;
|
|
24
|
-
onClick?: (e: any) => void;
|
|
25
|
-
className?: string;
|
|
26
|
-
rightButton?: React.ReactNode;
|
|
27
|
-
alwaysShowButton?: React.ReactNode;
|
|
28
|
-
}) => {
|
|
29
|
-
const { getQuery, updateQuery } = useQueryParams();
|
|
30
|
-
const activeId = activeValue ?? getQuery(queryKey);
|
|
31
|
-
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
const activeEl = document.getElementById(`${queryKey}${activeId}`);
|
|
34
|
-
if (activeEl) {
|
|
35
|
-
activeEl.scrollIntoView({
|
|
36
|
-
behavior: "smooth",
|
|
37
|
-
block: "nearest",
|
|
38
|
-
inline: "center",
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}, [tabs]);
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<div
|
|
45
|
-
className={cn(
|
|
46
|
-
"flex justify-between items-center bg-white h-[60px] px-3 gap-2 w-full",
|
|
47
|
-
className
|
|
48
|
-
)}
|
|
49
|
-
>
|
|
50
|
-
<div className="flex overflow-x-auto flex-1 relative hide-scrollbar">
|
|
51
|
-
{tabs?.map((tab) => (
|
|
52
|
-
<div
|
|
53
|
-
key={tab.id}
|
|
54
|
-
onClick={() => {
|
|
55
|
-
!activeValue && updateQuery(queryKey, tab.id.toString());
|
|
56
|
-
onClick && onClick(tab);
|
|
57
|
-
}}
|
|
58
|
-
className={`cursor-pointer px-4 h-12 max-h-12 flex items-center transition-colors min-w-fit rounded-lg ${
|
|
59
|
-
activeId === tab.id.toString()
|
|
60
|
-
? "bg-surface-primary text-text-active font-semibold"
|
|
61
|
-
: "font-medium text-gray-500 hover:text-gray-700 hover:border-gray-300"
|
|
62
|
-
}`}
|
|
63
|
-
id={`${queryKey}${tab.id}`}
|
|
64
|
-
>
|
|
65
|
-
{tab.name}
|
|
66
|
-
</div>
|
|
67
|
-
))}
|
|
68
|
-
</div>
|
|
69
|
-
<div className="flex gap-2 items-center">
|
|
70
|
-
{tabs?.length > 0 && rightButton} {alwaysShowButton}
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
);
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export const RefreshButton = ({ onRefresh }: { onRefresh: () => void }) => {
|
|
77
|
-
const [isRefresh, setIsRefresh] = useState(false);
|
|
78
|
-
|
|
79
|
-
setTimeout(() => {
|
|
80
|
-
if (isRefresh) {
|
|
81
|
-
setIsRefresh(false);
|
|
82
|
-
}
|
|
83
|
-
}, 3000);
|
|
84
|
-
|
|
85
|
-
return (
|
|
86
|
-
<ButtonIcon
|
|
87
|
-
onClick={() => {
|
|
88
|
-
setIsRefresh(true);
|
|
89
|
-
onRefresh();
|
|
90
|
-
}}
|
|
91
|
-
iconSrc={
|
|
92
|
-
<div className={`${isRefresh ? "spin" : ""}`}>
|
|
93
|
-
<IcRefresh />
|
|
94
|
-
</div>
|
|
95
|
-
}
|
|
96
|
-
/>
|
|
97
|
-
);
|
|
98
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { LoadDataModel, useSale } from "@provider/pos-provider/sale-provider";
|
|
2
|
-
|
|
3
|
-
const useCheckSession = () => {
|
|
4
|
-
const { getData } = useSale();
|
|
5
|
-
|
|
6
|
-
const onCheckSession = async () => {
|
|
7
|
-
const currentPos = getData(LoadDataModel.POS_CONFIG)?.[0];
|
|
8
|
-
|
|
9
|
-
const isSessionOpened = currentPos.pos_session_state === "opened";
|
|
10
|
-
|
|
11
|
-
return isSessionOpened;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
onCheckSession,
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default useCheckSession;
|
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import ButtonAction from "@components/common/button-action";
|
|
2
|
-
import Input from "@components/common/input";
|
|
3
|
-
import RadioGroup from "@components/common/input/radio-group";
|
|
4
|
-
import ModalDirection from "@components/common/modal/modal-direction";
|
|
5
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
6
|
-
import useGetQuery from "@hooks/common/use-get-query";
|
|
7
|
-
import { useCustomer } from "@provider/pos-provider/customer-provider";
|
|
8
|
-
import { useOrder } from "@provider/pos-provider/order-provider";
|
|
9
|
-
import { useSale } from "@provider/pos-provider/sale-provider";
|
|
10
|
-
import { useCustomerStore } from "@store/states/customer.state";
|
|
11
|
-
import { TCustomerPayload, TUpdateCustomerPayload } from "@type/customer";
|
|
12
|
-
import { filterObject, normalizeObject } from "@utils/functions";
|
|
13
|
-
import { useEffect, useMemo, useState } from "react";
|
|
14
|
-
import { useForm } from "react-hook-form";
|
|
15
|
-
import { useTranslation } from "react-i18next";
|
|
16
|
-
import { toast } from "react-toastify";
|
|
17
|
-
import z from "zod";
|
|
18
|
-
import AddressSelect, { TOption } from "./address-select";
|
|
19
|
-
|
|
20
|
-
type TProps = {
|
|
21
|
-
isOpen: boolean;
|
|
22
|
-
onClose: () => void;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const schema = z.object({
|
|
26
|
-
phone: z.string().min(1, "Số điện thoại là bắt buộc"),
|
|
27
|
-
name: z.string().min(1, "Tên khách hàng là bắt buộc"),
|
|
28
|
-
email: z.string(),
|
|
29
|
-
title: z.string().optional(),
|
|
30
|
-
street2: z.string().optional(),
|
|
31
|
-
birth_date: z.string().optional(),
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
export const AddCustomerDrawer = (props: TProps) => {
|
|
35
|
-
const { isOpen, onClose } = props;
|
|
36
|
-
const [isCreating, setIsCreating] = useState(false);
|
|
37
|
-
const [citySelected, setCitySelected] = useState<TOption>();
|
|
38
|
-
const [wardSelected, setWardSelected] = useState<TOption>();
|
|
39
|
-
|
|
40
|
-
const { t } = useTranslation();
|
|
41
|
-
const { createCustomer, updateCustomer } = useCustomer();
|
|
42
|
-
const { updateOrder } = useOrder();
|
|
43
|
-
const { queryResult } = useSale();
|
|
44
|
-
const { orderId } = useGetQuery();
|
|
45
|
-
const {
|
|
46
|
-
isEditMode,
|
|
47
|
-
customer: customerData,
|
|
48
|
-
setCustomer,
|
|
49
|
-
setIsEditMode,
|
|
50
|
-
} = useCustomerStore();
|
|
51
|
-
const { cities, setStateId, stateId, wards, partnerTitles } = useCustomer();
|
|
52
|
-
const customer = normalizeObject(customerData);
|
|
53
|
-
|
|
54
|
-
const cityMatched = useMemo(() => {
|
|
55
|
-
if (!customer?.state_id) return undefined;
|
|
56
|
-
|
|
57
|
-
return cities.find((city: any) => city.id === Number(customer?.state_id));
|
|
58
|
-
}, [cities, customer]);
|
|
59
|
-
|
|
60
|
-
const wardMatched = useMemo(() => {
|
|
61
|
-
if (!customer?.ward_id) return undefined;
|
|
62
|
-
|
|
63
|
-
return wards.find((ward: any) => ward.id === Number(customer?.ward_id));
|
|
64
|
-
}, [wards, customer]);
|
|
65
|
-
|
|
66
|
-
const {
|
|
67
|
-
handleSubmit,
|
|
68
|
-
register,
|
|
69
|
-
formState: { errors },
|
|
70
|
-
setError,
|
|
71
|
-
reset,
|
|
72
|
-
} = useForm({
|
|
73
|
-
mode: "onChange",
|
|
74
|
-
resolver: zodResolver(schema),
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
const clearData = () => {
|
|
78
|
-
setCitySelected(undefined);
|
|
79
|
-
setWardSelected(undefined);
|
|
80
|
-
setError("name", { message: "" });
|
|
81
|
-
setError("phone", { message: "" });
|
|
82
|
-
reset({
|
|
83
|
-
name: "",
|
|
84
|
-
email: "",
|
|
85
|
-
phone: "",
|
|
86
|
-
title: "",
|
|
87
|
-
street2: "",
|
|
88
|
-
birth_date: "",
|
|
89
|
-
});
|
|
90
|
-
setIsEditMode(false);
|
|
91
|
-
setCustomer(null);
|
|
92
|
-
setStateId("");
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const onSubmit = handleSubmit(async (data) => {
|
|
96
|
-
try {
|
|
97
|
-
setIsCreating(true);
|
|
98
|
-
|
|
99
|
-
const payload = filterObject({
|
|
100
|
-
name: data.name,
|
|
101
|
-
phone: data.phone,
|
|
102
|
-
email: data.email,
|
|
103
|
-
country_id: 241,
|
|
104
|
-
birth_date: data.birth_date,
|
|
105
|
-
state_id: Number(stateId),
|
|
106
|
-
ward_id: Number(wardSelected?.id),
|
|
107
|
-
street2: data.street2,
|
|
108
|
-
title: Number(data.title),
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
if (isEditMode) {
|
|
112
|
-
await updateCustomer.mutateAsync({
|
|
113
|
-
...payload,
|
|
114
|
-
id: Number(customer?.id),
|
|
115
|
-
} as TUpdateCustomerPayload);
|
|
116
|
-
} else {
|
|
117
|
-
const customerId = await createCustomer({
|
|
118
|
-
payload: payload as TCustomerPayload,
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
await updateOrder.mutateAsync({
|
|
122
|
-
orderId: Number(orderId),
|
|
123
|
-
partnerId: customerId,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
await Promise.all([queryResult.refetch()]);
|
|
128
|
-
|
|
129
|
-
clearData();
|
|
130
|
-
onClose();
|
|
131
|
-
|
|
132
|
-
if (isEditMode) {
|
|
133
|
-
toast.success(t("updateCustomerSuccess"));
|
|
134
|
-
} else {
|
|
135
|
-
toast.success(t("addCustomerSuccess"));
|
|
136
|
-
}
|
|
137
|
-
} catch (error: any) {
|
|
138
|
-
toast.error(error?.message);
|
|
139
|
-
} finally {
|
|
140
|
-
setIsCreating(false);
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
useEffect(() => {
|
|
145
|
-
if (!isOpen) {
|
|
146
|
-
clearData();
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (isEditMode && customer) {
|
|
151
|
-
reset({
|
|
152
|
-
name: customer.name,
|
|
153
|
-
phone: customer.phone,
|
|
154
|
-
email: typeof customer.email === "string" ? customer.email : "",
|
|
155
|
-
title: String(customer.title),
|
|
156
|
-
birth_date: customer.birth_date,
|
|
157
|
-
street2: customer.street2,
|
|
158
|
-
});
|
|
159
|
-
setStateId(String(customer.state_id));
|
|
160
|
-
setCitySelected({
|
|
161
|
-
id: Number(customer.state_id),
|
|
162
|
-
name: cityMatched?.name,
|
|
163
|
-
});
|
|
164
|
-
setWardSelected({
|
|
165
|
-
id: Number(customer.ward_id),
|
|
166
|
-
name: wardMatched?.name,
|
|
167
|
-
});
|
|
168
|
-
} else {
|
|
169
|
-
clearData();
|
|
170
|
-
}
|
|
171
|
-
}, [isOpen, wardMatched]);
|
|
172
|
-
|
|
173
|
-
return (
|
|
174
|
-
<ModalDirection
|
|
175
|
-
isOpen={isOpen}
|
|
176
|
-
onClose={onClose}
|
|
177
|
-
direction="right"
|
|
178
|
-
className="max-w-md bg-white font-medium"
|
|
179
|
-
title="Thông tin khách hàng"
|
|
180
|
-
>
|
|
181
|
-
<form onSubmit={onSubmit} className="flex flex-col h-full">
|
|
182
|
-
<div className="flex-1 overflow-y-auto pr-2 flex flex-col gap-4">
|
|
183
|
-
<Input
|
|
184
|
-
title="Họ và tên"
|
|
185
|
-
register={register("name")}
|
|
186
|
-
placeholder="Nhập họ và tên"
|
|
187
|
-
isRequired
|
|
188
|
-
name="name"
|
|
189
|
-
errorMessage={errors.name?.message}
|
|
190
|
-
inputClassName="p-3"
|
|
191
|
-
/>
|
|
192
|
-
|
|
193
|
-
<Input
|
|
194
|
-
title="Số điện thoại"
|
|
195
|
-
register={register("phone")}
|
|
196
|
-
name="phone"
|
|
197
|
-
isRequired
|
|
198
|
-
placeholder="Nhập số điện thoại"
|
|
199
|
-
errorMessage={errors.phone?.message}
|
|
200
|
-
inputClassName="p-3"
|
|
201
|
-
/>
|
|
202
|
-
|
|
203
|
-
<Input
|
|
204
|
-
title="Email"
|
|
205
|
-
register={register("email")}
|
|
206
|
-
placeholder="Nhập email"
|
|
207
|
-
name="email"
|
|
208
|
-
errorMessage={errors.email?.message}
|
|
209
|
-
inputClassName="p-3"
|
|
210
|
-
/>
|
|
211
|
-
|
|
212
|
-
<Input
|
|
213
|
-
title="Ngày sinh"
|
|
214
|
-
register={register("birth_date")}
|
|
215
|
-
placeholder="ngày/tháng/năm"
|
|
216
|
-
name="birth_date"
|
|
217
|
-
errorMessage={errors.birth_date?.message}
|
|
218
|
-
inputClassName="p-3"
|
|
219
|
-
type="date"
|
|
220
|
-
/>
|
|
221
|
-
|
|
222
|
-
<RadioGroup
|
|
223
|
-
title="Giới tính"
|
|
224
|
-
name="title"
|
|
225
|
-
register={register("title")}
|
|
226
|
-
options={partnerTitles}
|
|
227
|
-
errorMessage={errors.title?.message as string}
|
|
228
|
-
direction="row"
|
|
229
|
-
/>
|
|
230
|
-
|
|
231
|
-
<p className="font-semibold text-text-primary leading-6 tracking-[-0.24px]">
|
|
232
|
-
Địa chỉ
|
|
233
|
-
</p>
|
|
234
|
-
|
|
235
|
-
<AddressSelect
|
|
236
|
-
label="Tỉnh/Thành phố"
|
|
237
|
-
options={cities}
|
|
238
|
-
onSelect={(opt) => {
|
|
239
|
-
setCitySelected(opt);
|
|
240
|
-
setStateId(opt.id.toString());
|
|
241
|
-
}}
|
|
242
|
-
selectedValue={citySelected}
|
|
243
|
-
placeholder="Nhập tình/thành phố"
|
|
244
|
-
/>
|
|
245
|
-
|
|
246
|
-
{stateId && (
|
|
247
|
-
<AddressSelect
|
|
248
|
-
label="Phường/xã"
|
|
249
|
-
options={wards}
|
|
250
|
-
onSelect={(opt) => setWardSelected(opt)}
|
|
251
|
-
selectedValue={wardSelected}
|
|
252
|
-
placeholder="Nhập phường/xã"
|
|
253
|
-
/>
|
|
254
|
-
)}
|
|
255
|
-
|
|
256
|
-
<Input
|
|
257
|
-
title="Địa chỉ cụ thể"
|
|
258
|
-
register={register("street2")}
|
|
259
|
-
placeholder="Nhập địa chỉ cụ thể"
|
|
260
|
-
name="address"
|
|
261
|
-
errorMessage={errors.street2?.message}
|
|
262
|
-
inputClassName="p-3"
|
|
263
|
-
/>
|
|
264
|
-
</div>
|
|
265
|
-
|
|
266
|
-
<div className="flex items-center gap-2 pt-3">
|
|
267
|
-
<ButtonAction
|
|
268
|
-
onClick={onClose}
|
|
269
|
-
text={t("cancel")}
|
|
270
|
-
className="border border-stroke-disabled flex-1"
|
|
271
|
-
/>
|
|
272
|
-
|
|
273
|
-
<ButtonAction
|
|
274
|
-
type="submit"
|
|
275
|
-
disabled={isCreating}
|
|
276
|
-
className="flex-1 min-w-fit button-primary button disabled:bg-primary/50"
|
|
277
|
-
>
|
|
278
|
-
<p className="text-sm font-medium leading-5 tracking-[-0.12px] text-text-btn">
|
|
279
|
-
{isEditMode ? "Cập nhật" : "Lưu"}
|
|
280
|
-
</p>
|
|
281
|
-
</ButtonAction>
|
|
282
|
-
</div>
|
|
283
|
-
</form>
|
|
284
|
-
</ModalDirection>
|
|
285
|
-
);
|
|
286
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import DropdownSelector from "@components/common/dropdown";
|
|
2
|
-
|
|
3
|
-
export type TOption = {
|
|
4
|
-
id: number;
|
|
5
|
-
name: string;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
type TProps = {
|
|
9
|
-
label: string;
|
|
10
|
-
options: TOption[];
|
|
11
|
-
onSelect: (value: TOption) => void;
|
|
12
|
-
selectedValue: TOption | undefined;
|
|
13
|
-
placeholder?: string;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const AddressSelect = ({
|
|
17
|
-
label,
|
|
18
|
-
options,
|
|
19
|
-
onSelect,
|
|
20
|
-
selectedValue,
|
|
21
|
-
placeholder,
|
|
22
|
-
}: TProps) => {
|
|
23
|
-
return (
|
|
24
|
-
<div className="flex flex-col gap-[6px]">
|
|
25
|
-
<p className="text-sm font-medium text-text-primary leading-5 tracking-[-0.12px]">
|
|
26
|
-
{label}
|
|
27
|
-
</p>
|
|
28
|
-
|
|
29
|
-
<DropdownSelector<TOption>
|
|
30
|
-
options={options}
|
|
31
|
-
selectedValue={{
|
|
32
|
-
label: selectedValue?.name,
|
|
33
|
-
}}
|
|
34
|
-
onSelect={onSelect}
|
|
35
|
-
renderItem={(item) => {
|
|
36
|
-
return (
|
|
37
|
-
<div className="px-3 py-2 text-sm hover:bg-gray-50">
|
|
38
|
-
{item?.name}
|
|
39
|
-
</div>
|
|
40
|
-
);
|
|
41
|
-
}}
|
|
42
|
-
className="w-full"
|
|
43
|
-
buttonClassName="text-sm font-medium text-text-primary leading-5 tracking-[-0.12px] p-3"
|
|
44
|
-
dropdownClassName="w-full top-[calc(100%_+_4px)] flex flex-col gap-1 !max-h-[200px] overflow-y-auto !min-h-[200px]"
|
|
45
|
-
placeholder={placeholder}
|
|
46
|
-
/>
|
|
47
|
-
</div>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export default AddressSelect;
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import { IcSearch } from "@assets/icons/breadcrumbs-icon";
|
|
2
|
-
import { IcMore } from "@assets/icons/common";
|
|
3
|
-
import { IcCustomer, IcUserPlus } from "@assets/icons/user-icon";
|
|
4
|
-
import ModalDirection from "@components/common/modal/modal-direction";
|
|
5
|
-
import { useOrder } from "@provider/pos-provider/order-provider";
|
|
6
|
-
import { LoadDataModel, useSale } from "@provider/pos-provider/sale-provider";
|
|
7
|
-
import { useCustomerStore } from "@store/states/customer.state";
|
|
8
|
-
import { TCustomer } from "@type/customer";
|
|
9
|
-
import React, { useEffect, useState } from "react";
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
11
|
-
import { useDebounce } from "use-debounce";
|
|
12
|
-
import CustomerNoData from "./customer-no-data";
|
|
13
|
-
|
|
14
|
-
type TProps = {
|
|
15
|
-
isOpen: boolean;
|
|
16
|
-
onClose: () => void;
|
|
17
|
-
onOpenAddCustomerModal: () => void;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const ChooseCustomerDrawer = (props: TProps) => {
|
|
21
|
-
const { isOpen, onClose, onOpenAddCustomerModal } = props;
|
|
22
|
-
const { t } = useTranslation();
|
|
23
|
-
const { getData } = useSale();
|
|
24
|
-
const { onUpdateCustomer } = useOrder();
|
|
25
|
-
const [customerPhoneNumber, setCustomerPhoneNumber] = useState<string>("");
|
|
26
|
-
const [customerSearchValue] = useDebounce(customerPhoneNumber, 700);
|
|
27
|
-
|
|
28
|
-
const customers = getData(LoadDataModel.RES_PARTNER) as TCustomer[];
|
|
29
|
-
const [filteredCustomers, setFilteredCustomers] = useState<TCustomer[]>(
|
|
30
|
-
customers || []
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
const handleCustomerSelect = (customer: TCustomer) => {
|
|
34
|
-
onUpdateCustomer({
|
|
35
|
-
customer,
|
|
36
|
-
onSuccess: () => {
|
|
37
|
-
setCustomerPhoneNumber("");
|
|
38
|
-
onClose();
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const onSearch = async (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
44
|
-
setCustomerPhoneNumber(e.target.value);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const handleClose = () => {
|
|
48
|
-
setCustomerPhoneNumber("");
|
|
49
|
-
onClose();
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
if (!customers || !customers.length) return;
|
|
54
|
-
|
|
55
|
-
const lower = customerSearchValue.toLowerCase();
|
|
56
|
-
|
|
57
|
-
const filteredCustomers = customers?.filter((customer) => {
|
|
58
|
-
return (
|
|
59
|
-
customer.phone?.toString()?.includes(lower) ||
|
|
60
|
-
customer.name?.toString()?.toLowerCase()?.includes(lower)
|
|
61
|
-
);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
setFilteredCustomers(filteredCustomers || []);
|
|
65
|
-
}, [customerSearchValue, customers]);
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<>
|
|
69
|
-
<ModalDirection
|
|
70
|
-
isOpen={isOpen}
|
|
71
|
-
onClose={handleClose}
|
|
72
|
-
direction="right"
|
|
73
|
-
title={t("choose_customer")}
|
|
74
|
-
>
|
|
75
|
-
<div className="flex flex-col h-full gap-6">
|
|
76
|
-
<div className="flex items-center justify-center gap-3">
|
|
77
|
-
<div
|
|
78
|
-
style={{
|
|
79
|
-
boxShadow: "0 16px 32px -12px rgba(88, 92, 95, 0.10);",
|
|
80
|
-
}}
|
|
81
|
-
className="flex w-full border h-11 border-stroke-default rounded-lg items-center gap-2 p-2"
|
|
82
|
-
>
|
|
83
|
-
<IcSearch />
|
|
84
|
-
|
|
85
|
-
<input
|
|
86
|
-
value={customerPhoneNumber}
|
|
87
|
-
onChange={(e) => onSearch(e)}
|
|
88
|
-
placeholder={t("search...")}
|
|
89
|
-
className="outline-none flex-1 text-sm leading-5 tracking-[-0.12px] text-text-primary placeholder:text-tertiary"
|
|
90
|
-
/>
|
|
91
|
-
</div>
|
|
92
|
-
|
|
93
|
-
<button
|
|
94
|
-
onClick={onOpenAddCustomerModal}
|
|
95
|
-
className="h-11 px-3 py-2 bg-primary text-text-btn rounded-lg flex items-center justify-center gap-2"
|
|
96
|
-
>
|
|
97
|
-
<IcUserPlus />
|
|
98
|
-
<span className="text-sm font-medium leading-5 tracking-[-0.12px]">
|
|
99
|
-
{t("add")}
|
|
100
|
-
</span>
|
|
101
|
-
</button>
|
|
102
|
-
</div>
|
|
103
|
-
|
|
104
|
-
<div className="flex-1 overflow-y-auto space-y-3 pr-2">
|
|
105
|
-
{filteredCustomers && filteredCustomers.length > 0 ? (
|
|
106
|
-
filteredCustomers.map((customer: TCustomer) => (
|
|
107
|
-
<CustomerItem
|
|
108
|
-
key={customer.id}
|
|
109
|
-
customer={customer}
|
|
110
|
-
onCustomerSelect={handleCustomerSelect}
|
|
111
|
-
onOpenAddCustomerModal={onOpenAddCustomerModal}
|
|
112
|
-
/>
|
|
113
|
-
))
|
|
114
|
-
) : customerPhoneNumber !== "" ? (
|
|
115
|
-
<CustomerNoData />
|
|
116
|
-
) : (
|
|
117
|
-
<></>
|
|
118
|
-
)}
|
|
119
|
-
</div>
|
|
120
|
-
</div>
|
|
121
|
-
</ModalDirection>
|
|
122
|
-
</>
|
|
123
|
-
);
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
const CustomerItem = ({
|
|
127
|
-
customer,
|
|
128
|
-
onCustomerSelect,
|
|
129
|
-
onOpenAddCustomerModal,
|
|
130
|
-
}: {
|
|
131
|
-
customer: TCustomer;
|
|
132
|
-
onCustomerSelect: (customer: TCustomer) => void;
|
|
133
|
-
onOpenAddCustomerModal: () => void;
|
|
134
|
-
}) => {
|
|
135
|
-
const { setCustomer, setIsEditMode } = useCustomerStore();
|
|
136
|
-
|
|
137
|
-
const onEditCustomer = () => {
|
|
138
|
-
onOpenAddCustomerModal();
|
|
139
|
-
setCustomer(customer);
|
|
140
|
-
setIsEditMode(true);
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
return (
|
|
144
|
-
<div
|
|
145
|
-
key={customer.id}
|
|
146
|
-
onClick={() => onCustomerSelect(customer)}
|
|
147
|
-
className="flex items-center justify-between gap-3 py-4 px-3 hover:bg-gray-50 border-stroke-default rounded-lg cursor-pointer border"
|
|
148
|
-
>
|
|
149
|
-
<div className="flex items-center space-x-3">
|
|
150
|
-
<div className="p-[10px] bg-brand-50 rounded-full flex items-center justify-center">
|
|
151
|
-
<IcCustomer />
|
|
152
|
-
</div>
|
|
153
|
-
<div className="flex flex-col gap-[2px]">
|
|
154
|
-
<p className="text-sm font-semibold leading-5 text-text-primary tracking-[-0.12px]">
|
|
155
|
-
{customer.name}
|
|
156
|
-
</p>
|
|
157
|
-
<p className="text-xs leading-4 text-text-secondary">
|
|
158
|
-
{customer.phone}
|
|
159
|
-
</p>
|
|
160
|
-
<p className="text-xs leading-4 text-text-secondary">
|
|
161
|
-
{customer.email}
|
|
162
|
-
</p>
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
|
|
166
|
-
<button
|
|
167
|
-
onClick={(e) => {
|
|
168
|
-
e.stopPropagation();
|
|
169
|
-
onEditCustomer();
|
|
170
|
-
}}
|
|
171
|
-
className="p-2 px-4 hover:bg-gray-200 rounded"
|
|
172
|
-
>
|
|
173
|
-
<IcMore />
|
|
174
|
-
</button>
|
|
175
|
-
</div>
|
|
176
|
-
);
|
|
177
|
-
};
|