@extends('pages.layouts.app') @section('content')

{{ __('My Orders') }}

@if($orders->count())
@foreach($orders as $order) @php $statusColors = [ 'pending' => '#ffc107', // Yellow 'confirmed' => '#17a2b8', // Blue 'shipped' => '#007bff', // Dark Blue 'out_for_delivery' => '#ff851b', // Orange 'delivered' => '#28a745', // Green 'canceled' => '#dc3545', // Red 'refunded' => '#6c757d', // Gray ]; $statusColor = $statusColors[$order->status] ?? '#6c757d'; // Default color (Gray) @endphp @endforeach
{{ __('Order ID') }} {{ __('Order Date') }} {{ __('Total Amount') }} {{ __('Status') }} {{ __('Address') }} {{ __('Items') }} {{ __('Actions') }}
{{ $order->id }} {{ $order->created_at->format('M d, Y') }} ${{ number_format($order->total_amount, 2) }} {{ ucfirst(str_replace('_', ' ', __($order->status))) }} {{ $order->address ? $order->address->city->name . ', ' . $order->address->address : 'N/A' }} @foreach($order->orderItems as $item)

{{ $item->product->name }} (x{{ $item->quantity }}) @if ($item->color) {{ app()->getLocale() === 'ar' ? $item->color->name_ar : $item->color->name }} @endif

@endforeach
@if($order->status == 'pending') {{ __('Complete Your Order') }} @else {{ __('Order') . ' '. __($order->status) }} @endif
{{ $orders->links() }}
@else
{{ __('No orders found') }} {{ __('You havent placed any orders yet') }}
@endif
@endsection @push('styles') @endpush