From 52ec0b9b86999dfb2fdbafb1d682a3a89e1882ba Mon Sep 17 00:00:00 2001 From: dwindown Date: Sun, 28 Dec 2025 22:01:58 +0700 Subject: [PATCH] Merge consulting order details into single card MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Consolidate "Informasi Order" and "Detail Sesi Konsultasi" cards into one - Remove duplicate "Order Info" card for consulting orders - Display all information in single, cleaner merged card: - Session details (time, date, category, notes, meet link) - QR code for pending payments - Expired/cancelled order handling with rebooking - Status alerts (paid/cancelled/pending) - Total payment - Keep separate cards for product orders unchanged 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- src/pages/member/OrderDetail.tsx | 535 ++++++++++++++++++------------- 1 file changed, 310 insertions(+), 225 deletions(-) diff --git a/src/pages/member/OrderDetail.tsx b/src/pages/member/OrderDetail.tsx index db00384..3000c74 100644 --- a/src/pages/member/OrderDetail.tsx +++ b/src/pages/member/OrderDetail.tsx @@ -333,37 +333,38 @@ export default function OrderDetail() { - {/* Order Info */} - - - - - Informasi Order - - - -
-
-

Tanggal Order

-

{formatDate(order.created_at)}

-
-
-

Terakhir Update

-

{formatDate(order.updated_at)}

-
- {order.payment_method && ( + {/* Order Info - Only show for product orders */} + {!isConsultingOrder && ( + + + + + Informasi Order + + + +
-

Metode Pembayaran

-

{order.payment_method}

+

Tanggal Order

+

{formatDate(order.created_at)}

- )} - {order.payment_provider && (
-

Provider

-

{order.payment_provider}

+

Terakhir Update

+

{formatDate(order.updated_at)}

- )} -
+ {order.payment_method && ( +
+

Metode Pembayaran

+

{order.payment_method}

+
+ )} + {order.payment_provider && ( +
+

Provider

+

{order.payment_provider}

+
+ )} +
{/* QR Code Display for pending QRIS payments */} {order.payment_status === "pending" && order.payment_method === "qris" && !isQrExpired && ( @@ -442,78 +443,46 @@ export default function OrderDetail() { - {isConsultingOrder - ? "Waktu pembayaran telah habis. Slot konsultasi telah dilepaskan. Silakan buat booking baru." - : "QR Code telah kadaluarsa. Anda dapat me-regenerate QR code untuk melanjutkan pembayaran."} + QR Code telah kadaluarsa. Anda dapat me-regenerate QR code untuk melanjutkan pembayaran. - {isConsultingOrder ? ( - // Consulting order - show booking button with pre-filled data -
+ {/* Product order - show regenerate button */} +
+
+

{formatIDR(order.total_amount)}

- Order ini telah dibatalkan secara otomatis karena waktu pembayaran habis. -

- -

- Kategori dan catatan akan terisi otomatis dari order sebelumnya + Order ID: {order.id.slice(0, 8)}

- ) : ( - // Product order - show regenerate button -
-
-

{formatIDR(order.total_amount)}

-

- Order ID: {order.id.slice(0, 8)} -

-
- + - -
- )} + +
)} @@ -523,48 +492,19 @@ export default function OrderDetail() { - {isConsultingOrder - ? "Order ini telah dibatalkan. Slot konsultasi telah dilepaskan." - : "Order ini telah dibatalkan."} + Order ini telah dibatalkan. - {isConsultingOrder ? ( - // Consulting order - show booking button with pre-filled data -
- -

- Kategori dan catatan akan terisi otomatis dari order sebelumnya -

-
- ) : ( - // Product order - show back to products button - - )} + {/* Product order - show back to products button */} + )} @@ -581,120 +521,265 @@ export default function OrderDetail() { )}
+ )} {/* Smart Item/Service Display */} {consultingSlots.length > 0 ? ( - // === Consulting Orders (NO order_items, has consulting_sessions) === - <> - - - - - - - {/* Summary Card */} -
-
+ // === Consulting Orders - Single Merged Card === + + + + + + + {/* Session Information */} +
+
+
+

Waktu Konsultasi

+

+ {consultingSlots[0].start_time.substring(0,5)} - {consultingSlots[0].end_time.substring(0,5)} +

+
+ +
+

Tanggal

+

+ {new Date(consultingSlots[0].session_date).toLocaleDateString("id-ID", { + weekday: "long", + year: "numeric", + month: "long", + day: "numeric" + })} +

+
+ + {consultingSlots[0]?.topic_category && (
-

Waktu Konsultasi

-

- {consultingSlots[0].start_time.substring(0,5)} - {consultingSlots[0].end_time.substring(0,5)} -

+

Kategori

+

{consultingSlots[0].topic_category}

+ )} + {consultingSlots[0]?.notes && (
-

Tanggal

-

- {new Date(consultingSlots[0].session_date).toLocaleDateString("id-ID", { - weekday: "long", - year: "numeric", - month: "long", - day: "numeric" - })} -

+

Catatan

+

{consultingSlots[0].notes}

+ )} - {consultingSlots[0]?.topic_category && ( + {consultingSlots[0]?.meet_link && ( +
-

Kategori

-

{consultingSlots[0].topic_category}

-
- )} - - {consultingSlots[0]?.notes && ( -
-

Catatan

-

{consultingSlots[0].notes}

-
- )} - - {consultingSlots[0]?.meet_link && ( -
- - + {consultingSlots[0].meet_link.substring(0, 40)}... +
- )} + +
+ )} +
+
+ + {/* QR Code Display for pending QRIS payments */} + {order.payment_status === "pending" && order.payment_method === "qris" && !isQrExpired && ( +
+ {order.qr_string ? ( + <> + + + + Scan QR code ini dengan aplikasi e-wallet atau mobile banking Anda + {timeRemaining && ( + + (Kadaluarsa dalam {timeRemaining}) + + )} + + + +
+
+ +
+ +
+

{formatIDR(order.total_amount)}

+

+ Order ID: {order.id.slice(0, 8)} +

+
+ + {isPolling && ( +
+ + Menunggu pembayaran... +
+ )} + +
+ 🔒 Pembayaran Aman + ⚡ QRIS Standar Bank Indonesia +
+ + {order.payment_url && ( + + )} +
+ + ) : ( + + + + Sedang memproses QR code... + {order.payment_url && ( + + )} + + + )} +
+ )} + + {/* Expired QR Handling for Consulting */} + {order.payment_status === "pending" && order.payment_method === "qris" && isQrExpired && ( +
+ + + + Waktu pembayaran telah habis. Slot konsultasi telah dilepaskan. Silakan buat booking baru. + + + +
+

+ Order ini telah dibatalkan secara otomatis karena waktu pembayaran habis. +

+ +

+ Kategori dan catatan akan terisi otomatis dari order sebelumnya +

+ )} - {/* Status Alert */} - {order.payment_status === "paid" ? ( - -