+
• Customer Profile
+
+
+ Customer Name: {user?.name}
+
+
+ Customer ID: {user?._id}
+
+
+ Date Registered :
+
+ {" "}
+ {new Date(user?.createdAt).toLocaleString("en-IN", {
+ weekday: "short",
+ month: "short",
+ day: "numeric",
+ year: "numeric",
+ hour: "numeric",
+ minute: "numeric",
+ hour12: true,
+ })}
+
+
+
+ Last Purchase:
+
+ {userOrder?.length > 0
+ ? new Date(userOrder[0]?.createdAt).toLocaleString("en-IN", {
+ weekday: "short",
+ month: "short",
+ day: "numeric",
+ year: "numeric",
+ hour: "numeric",
+ minute: "numeric",
+ hour12: true,
+ })
+ : userOrder
+ ? "No Purchase"
+ : "Loading"}
+
+
+
+
+
+ • Addresses{" "}
+
+
+ • Total Addresses : {userAllAddress?.length}{" "}
+
+ {userAllAddress?.length > 0 && (
+
+
+
+
+ SL No. |
+ Address |
+ {/* Profile Image | */}
+
+
+
+ {userAllAddress?.length === 0 && (
+
+
+ No Data Available
+ |
+
+ )}
+ {userAllAddress?.map((address, i) => {
+ return (
+
+ {i + 1} |
+
+
+ {address?.first_Name} {address?.last_name},
+ {address?.phone_Number},{address?.street},
+ {address?.city},{address?.state},{address?.country},
+ {address?.postalCode}
+
+ |
+
+ );
+ })}
+
+
+
+ )}
+
+
+
+ • Orders{" "}
+
+
+ • Total Orders : {userOrder?.length}{" "}
+
+
+ • Total Spent : ₹ {totalSpent}{" "}
+
+ {userOrder?.length > 0 && (
+
+
+
+
+ SL No. |
+ Order Date |
+ Order Id |
+ Items |
+ Order Amount |
+ {/* Profile Image | */}
+
+
+
+ {userAllAddress?.length === 0 && (
+
+
+ No Data Available
+ |
+
+ )}
+ {userOrder?.map((order, i) => {
+ return (
+
+ {i + 1} |
+
+ {" "}
+ {new Date(order?.createdAt).toLocaleString("en-IN", {
+ weekday: "short",
+ month: "short",
+ day: "numeric",
+ year: "numeric",
+ hour: "numeric",
+ minute: "numeric",
+ hour12: true,
+ })}
+ |
+ {order?.orderID} |
+
+ {order?.orderItems?.map((item, i) => (
+
+ {item?.name}
+
+ {item?.image?.map((img, i) => (
+ 
+ ))}
+
+
+ ))}
+ |
+ ₹ {order?.total_amount} |
+
+ );
+ })}
+
+
+
+ )}
+
+