{firstName + ' ' + lastName}
{Role? Role.name: 'buyer'}
+{message}
+Id:
+{order.id}
+Status:
+{order.status}
+{order.updatedAt}
+Total Price:
+{order.totalPrice}
+Loading...
; + } + + if (orderItemsError) { + returnError loading order details: {orderItemsError}
; + } + + if (orderItems.length === 0) { + returnNo order details found
; + } + + const handleCancelOrder = async (orderId: string) => { + setOrderIdToCancel(orderId); + setConfirmModalOpen(true); + }; + + const confirmCancelOrder = async () => { + if (!orderIdToCancel) return; + + try { + await cancelOrderMutation(orderIdToCancel).unwrap(); + dispatch(setActiveMenu({ activeMenu: "orders" })) + setConfirmModalOpen(false); + } catch (error) { + console.error('Error cancelling order:', error); + } + }; + + const handleAddFeedback = (product: any) => { + setCurrentProduct(product); + setModalOpen(true); + }; + + const handleModalClose = () => { + setModalOpen(false); + setCurrentProduct(null); + }; + + const handleFeedbackSubmit = (feedback: { message: string; image: File | null; rating: number }) => { + console.log('Feedback submitted for product:', currentProduct?.id); + console.log('Feedback details:', feedback); + setModalOpen(false); + setCurrentProduct(null); + }; + + return ( +Id:
+{order.id}
+Status:
+{order.status}
+Total Price:
+${order.totalPrice}
+Id:
+{order.id}
+Status:
+{order.status}
+Total Price:
+{order.totalPrice}
+${item.price}
+