|
@ -37,26 +37,27 @@ const RecentOrders = ({ |
|
|
const { t } = useTranslation(); |
|
|
const { t } = useTranslation(); |
|
|
const { alignLeft, alignRight } = useIsRTL(); |
|
|
const { alignLeft, alignRight } = useIsRTL(); |
|
|
const rowExpandable = (record: any) => record.children?.length; |
|
|
const rowExpandable = (record: any) => record.children?.length; |
|
|
|
|
|
console.log(orders); |
|
|
|
|
|
|
|
|
const columns = [ |
|
|
const columns = [ |
|
|
{ |
|
|
{ |
|
|
title: t('table:table-item-tracking-number'), |
|
|
title: t('table:table-item-tracking-number'), |
|
|
dataIndex: 'tracking_number', |
|
|
|
|
|
|
|
|
dataIndex: 'transaction_id', |
|
|
key: 'tracking_number', |
|
|
key: 'tracking_number', |
|
|
align: alignLeft, |
|
|
align: alignLeft, |
|
|
width: 200, |
|
|
width: 200, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: t('table:table-item-customer'), |
|
|
title: t('table:table-item-customer'), |
|
|
dataIndex: 'customer', |
|
|
|
|
|
key: 'name', |
|
|
|
|
|
|
|
|
dataIndex: 'user_info', |
|
|
|
|
|
key: 'user', |
|
|
align: alignLeft, |
|
|
align: alignLeft, |
|
|
width: 250, |
|
|
width: 250, |
|
|
render: (customer: any) => ( |
|
|
render: (customer: any) => ( |
|
|
<div className="flex items-center"> |
|
|
<div className="flex items-center"> |
|
|
<Avatar name={customer?.name} /> |
|
|
|
|
|
|
|
|
<Avatar name={customer?.user} /> |
|
|
<div className="flex flex-col whitespace-nowrap font-medium ms-2"> |
|
|
<div className="flex flex-col whitespace-nowrap font-medium ms-2"> |
|
|
{customer?.name ? customer?.name : t('common:text-guest')} |
|
|
|
|
|
|
|
|
{customer?.user ? customer?.user : t('common:text-guest')} |
|
|
<span className="text-[13px] font-normal text-gray-500/80"> |
|
|
<span className="text-[13px] font-normal text-gray-500/80"> |
|
|
{customer?.email} |
|
|
{customer?.email} |
|
|
</span> |
|
|
</span> |
|
@ -66,7 +67,7 @@ const RecentOrders = ({ |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: t('table:table-item-products'), |
|
|
title: t('table:table-item-products'), |
|
|
dataIndex: 'products', |
|
|
|
|
|
|
|
|
dataIndex: 'items', |
|
|
key: 'products', |
|
|
key: 'products', |
|
|
align: 'center', |
|
|
align: 'center', |
|
|
render: (products: Product) => <span>{products.length}</span>, |
|
|
render: (products: Product) => <span>{products.length}</span>, |
|
@ -75,7 +76,7 @@ const RecentOrders = ({ |
|
|
{ |
|
|
{ |
|
|
// title: t('table:table-item-order-date'),
|
|
|
// title: t('table:table-item-order-date'),
|
|
|
title: t('table:table-item-order-date'), |
|
|
title: t('table:table-item-order-date'), |
|
|
dataIndex: 'created_at', |
|
|
|
|
|
|
|
|
dataIndex: 'created', |
|
|
key: 'created_at', |
|
|
key: 'created_at', |
|
|
align: 'center', |
|
|
align: 'center', |
|
|
render: (date: string) => { |
|
|
render: (date: string) => { |
|
@ -91,7 +92,7 @@ const RecentOrders = ({ |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: t('table:table-item-total'), |
|
|
title: t('table:table-item-total'), |
|
|
dataIndex: 'total', |
|
|
|
|
|
|
|
|
dataIndex: 'total_price', |
|
|
key: 'total', |
|
|
key: 'total', |
|
|
align: 'center', |
|
|
align: 'center', |
|
|
render: function Render(value: any) { |
|
|
render: function Render(value: any) { |
|
@ -103,7 +104,7 @@ const RecentOrders = ({ |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: t('table:table-item-status'), |
|
|
title: t('table:table-item-status'), |
|
|
dataIndex: 'order_status', |
|
|
|
|
|
|
|
|
dataIndex: 'status', |
|
|
key: 'order_status', |
|
|
key: 'order_status', |
|
|
align: 'center', |
|
|
align: 'center', |
|
|
render: (order_status: OrderStatus) => ( |
|
|
render: (order_status: OrderStatus) => ( |
|
|