@extends('layouts.app') @section('content') @php $status = $order->status; $isCancelled = $status === 'cancelled'; // Timeline steps with status logic (same logic as original) $steps = [ [ 'id' => 'placed', 'title' => 'অর্ডার সফল হয়েছে', 'subtitle' => 'আমরা আপনার অর্ডারটি পেয়েছি।', 'icon' => 'fa-clipboard-check', 'status' => $isCancelled ? 'cancelled' : 'completed', 'date' => $order->created_at->format('d M, Y - h:i A'), ], [ 'id' => 'processing', 'title' => 'প্রসেসিং হচ্ছে', 'subtitle' => 'আপনার পণ্য প্যাকিং করা হচ্ছে।', 'icon' => 'fa-box-open', 'status' => $isCancelled ? 'cancelled' : (in_array($status, ['processing','shipped','delivered']) ? ($status === 'processing' ? 'in-progress' : 'completed') : 'pending'), 'date' => in_array($status, ['processing','shipped','delivered']) ? 'সম্পন্ন' : 'অপেক্ষমান', ], [ 'id' => 'shipped', 'title' => 'ডেলিভারির জন্য পাঠানো হয়েছে', 'subtitle' => 'পার্সেলটি কুরিয়ারে হস্তান্তর করা হয়েছে।', 'icon' => 'fa-truck-fast', 'status' => $isCancelled ? 'cancelled' : (in_array($status, ['shipped','delivered']) ? ($status === 'shipped' ? 'in-progress' : 'completed') : 'pending'), 'date' => in_array($status, ['shipped','delivered']) ? 'সম্পন্ন' : 'অপেক্ষমান', ], [ 'id' => 'delivered', 'title' => 'ডেলিভারি সম্পন্ন', 'subtitle' => 'পণ্যটি আপনার হাতে পৌঁছেছে।', 'icon' => 'fa-house-chimney', 'status' => $isCancelled ? 'cancelled' : ($status === 'delivered' ? 'completed' : 'pending'), 'date' => $status === 'delivered' ? 'সম্পন্ন' : 'অপেক্ষমান', ], ]; @endphp
{{-- Main Card --}}
{{-- Header --}}

অর্ডার আইডি: #{{ $order->id }}

{{ $order->created_at->format('d M, Y | h:i A') }}

@php $badgeColors = match($status) { 'delivered' => 'bg-green-100 text-green-700', 'cancelled' => 'bg-red-100 text-red-700', 'shipped' => 'bg-blue-100 text-blue-700', 'processing' => 'bg-yellow-100 text-yellow-700', default => 'bg-orange-100 text-orange-700', }; @endphp {{ $order->status }}
{{-- Customer Info --}}

{{ $order->customer_name }}

{{ $order->customer_phone }}

{{-- Tracking Timeline (TrackingTimeline React component style) --}}

Order History

@if($isCancelled) {{-- Cancelled State --}}

অর্ডার বাতিল করা হয়েছে

দুঃখিত, আপনার অর্ডারটি বাতিল করা হয়েছে।

@else {{-- Active Timeline --}}
    @foreach($steps as $i => $step)
  1. {{-- Icon Circle --}} {{-- Pulsing ring for in-progress --}} @if($step['status'] === 'in-progress') @endif @if($step['status'] === 'completed') @elseif($step['status'] === 'in-progress') @else @endif {{-- Content --}}

    {{ $step['title'] }}

    {{ $step['date'] }}

  2. @endforeach
@endif {{-- Action Buttons --}}
@endsection