Fix consulting order QR display and remove duplicate slots card

1. QR Code Display Fix:
   - Removed qr_string from required condition
   - Added fallback for when QR is still processing
   - Shows payment_url button if QR string not available yet
   - Helps users pay while QR code is being generated

2. Consulting Slots Display Fix:
   - Removed duplicate "Detail Jadwal" card
   - Slots now only shown once in main session card
   - Displays as continuous time range (start to end)
   - Shows total duration (e.g., "3 blok (135 menit)")

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
dwindown
2025-12-26 22:24:21 +07:00
parent 2dae2fdc33
commit a567b683af

View File

@@ -341,8 +341,10 @@ export default function OrderDetail() {
</div>
{/* QR Code Display for pending QRIS payments */}
{order.payment_status === "pending" && order.payment_method === "qris" && order.qr_string && !isQrExpired && (
{order.payment_status === "pending" && order.payment_method === "qris" && !isQrExpired && (
<div className="pt-4">
{order.qr_string ? (
<>
<Alert className="mb-4">
<Clock className="h-4 w-4" />
<AlertDescription>
@@ -388,6 +390,24 @@ export default function OrderDetail() {
</Button>
)}
</div>
</>
) : (
// No QR string yet - show loading or payment URL option
<Alert className="border-orange-200 bg-orange-50">
<Clock className="h-4 w-4 text-orange-600" />
<AlertDescription className="text-orange-900">
Sedang memproses QR code...
{order.payment_url && (
<Button asChild className="mt-2" variant="outline" size="sm">
<a href={order.payment_url} target="_blank" rel="noopener noreferrer">
<CreditCard className="w-4 h-4 mr-2" />
Bayar di Halaman Pembayaran
</a>
</Button>
)}
</AlertDescription>
</Alert>
)}
</div>
)}
@@ -546,28 +566,6 @@ export default function OrderDetail() {
</div>
</CardContent>
</Card>
{/* Consulting Slots Detail */}
<Card className="border-2 border-border mb-6">
<CardHeader>
<CardTitle className="text-lg">Detail Jadwal</CardTitle>
</CardHeader>
<CardContent>
<div className="space-y-3">
{consultingSlots.map((slot, index) => (
<div key={slot.id} className="flex items-center justify-between py-2 border-b last:border-b-0">
<div>
<p className="text-sm text-muted-foreground">Blok {index + 1}</p>
<p className="font-medium">{slot.start_time.substring(0, 5)} - {slot.end_time.substring(0, 5)} WIB</p>
</div>
<Badge variant={slot.status === "confirmed" ? "default" : "secondary"}>
{slot.status === "confirmed" ? "Terkonfirmasi" : slot.status}
</Badge>
</div>
))}
</div>
</CardContent>
</Card>
</>
) : order.order_items.length > 0 ? (
// === Product Orders (has order_items) ===