From 1e82c8bf97ce8dde4c1582cbd33a2932fbe72b13 Mon Sep 17 00:00:00 2001 From: SRUTHY R <117913189+Sruthy1810@users.noreply.github.com> Date: Fri, 18 Oct 2024 18:01:10 +0530 Subject: [PATCH] Updated index.js Added customer address inside admin order list --- .../app/components/Manager/OrderList/index.js | 53 ++++++++----------- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/client/app/components/Manager/OrderList/index.js b/client/app/components/Manager/OrderList/index.js index 59a28a82..bdc4a103 100644 --- a/client/app/components/Manager/OrderList/index.js +++ b/client/app/components/Manager/OrderList/index.js @@ -1,70 +1,59 @@ -/** - * - * OrderList - * - */ - import React from 'react'; - import { Link } from 'react-router-dom'; - import { formatDate } from '../../../utils/date'; -const OrderList = props => { +const OrderList = (props) => { const { orders } = props; - const renderFirstItem = order => { + const renderFirstItem = (order) => { if (order.products) { const product = order.products[0].product; return ( product ); } else { - return ; + return placeholder; } }; return ( -
+
{orders.map((order, index) => ( -
- -
-
+
+ +
+
{renderFirstItem(order)}
-
-
-
+
+
+
Status {order?.products ? ( - {` ${order?.products[0].status}`} + {` ${order?.products[0].status}`} ) : ( - {` Unavailable`} + Unavailable )}
-
+
Order # - {` ${order._id}`} + {` ${order._id}`}
-
+
Ordered on - {` ${formatDate( - order.created - )}`} + {` ${formatDate(order.created)}`}
-
+
Order Total - {` $${ - order?.totalWithTax ? order?.totalWithTax : 0 - }`} + {` $${order?.totalWithTax ? order?.totalWithTax : 0}`}