[d7b7f00] | 1 | import styles from "../../css/AdminPanelCss/modal-style.module.css";
|
---|
| 2 |
|
---|
| 3 | const AdminOrderReviewModal = ({ isOpen, onClose, orderReviewData, onRemove }) => {
|
---|
| 4 | if (!isOpen ||
|
---|
| 5 | orderReviewData.user === undefined ||
|
---|
| 6 | orderReviewData.order === undefined ||
|
---|
| 7 | orderReviewData.deliveryPerson === null
|
---|
| 8 | ) return null;
|
---|
| 9 |
|
---|
| 10 | const { user, order, deliveryPerson } = orderReviewData
|
---|
| 11 | const addr = order.address.split(";");
|
---|
| 12 | console.log(addr)
|
---|
| 13 | console.log(user)
|
---|
| 14 | console.log(order)
|
---|
| 15 | console.log(deliveryPerson)
|
---|
| 16 | console.log(order.id)
|
---|
| 17 |
|
---|
| 18 | const handleRemove = () => {
|
---|
| 19 | onRemove(order.id);
|
---|
| 20 | onClose();
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | return (
|
---|
| 24 | <div className={styles.modalOverlay}>
|
---|
| 25 | <div className={styles.modalContent}>
|
---|
| 26 | <button className={styles.closeButton} onClick={onClose}>×</button>
|
---|
| 27 | <h2>Review Details</h2>
|
---|
| 28 |
|
---|
| 29 | <h3>User Details</h3>
|
---|
| 30 | <p><strong>Name:</strong> {user.name} {user.surname} </p>
|
---|
| 31 | <p><strong>Email:</strong> {user.email} </p>
|
---|
| 32 | <p><strong>Phone Number:</strong> {user.phoneNumber} </p>
|
---|
| 33 | <p><strong>Deliver To:</strong> {addr[0] || ""} {addr[1] || ""} {addr[2] || ""} </p>
|
---|
| 34 |
|
---|
| 35 | <h3>Delivery Person Details</h3>
|
---|
| 36 | <p><strong>Name:</strong> {deliveryPerson.name} {deliveryPerson.surname} </p>
|
---|
| 37 | <p><strong>Email:</strong> {deliveryPerson.email} </p>
|
---|
| 38 | <p><strong>Phone Number:</strong> {deliveryPerson.phoneNumber} </p>
|
---|
| 39 |
|
---|
| 40 | <h3>Review:</h3>
|
---|
| 41 | <p><strong>Rating:</strong> {order.rating}</p>
|
---|
| 42 | <p>{order.review}</p>
|
---|
| 43 |
|
---|
| 44 | <button onClick={handleRemove} className={styles.removeButton}>
|
---|
| 45 | Remove Review
|
---|
| 46 | </button>
|
---|
| 47 | </div>
|
---|
| 48 | </div>
|
---|
| 49 | );
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 | export default AdminOrderReviewModal; |
---|