@extends('layouts.motoboy_dashboard') @section('content')

{{ $title }}

@forelse($entregas as $entrega)

Entrega #{{ $entrega->id }}

@php $deliveryStatusClasses = [ 'em_coleta' => 'bg-blue-100 text-blue-800', 'em_transito' => 'bg-indigo-100 text-indigo-800', 'na_area' => 'bg-orange-100 text-orange-800', 'aguardando_retorno_motoboy' => 'bg-yellow-100 text-yellow-800', 'concluido' => 'bg-green-100 text-green-800', 'rejeitado' => 'bg-red-100 text-red-800', 'cancelado' => 'bg-gray-100 text-gray-800', 'problema' => 'bg-red-200 text-red-900', ]; $currentDeliveryStatusClass = $deliveryStatusClasses[$entrega->status] ?? 'bg-gray-200 text-gray-700'; @endphp {{ ucfirst(str_replace('_', ' ', $entrega->status)) }}

Pedido Troca: #{{ $entrega->pedidoTroca->codigo_troca ?? 'N/A' }}

Medicamento: {{ $entrega->pedidoTroca->medicamento->name ?? 'N/A' }}

Origem: @php $ownerAddress = $entrega->pedidoTroca->medicamento->owner->enderecos->first(); @endphp {{ $ownerAddress->bairro ?? 'Bairro N/A' }} @if ($ownerAddress->cidade ?? false) , {{ $ownerAddress->cidade }} @endif

Solicitante: {{ $entrega->pedidoTroca->requester->name ?? 'N/A' }}

Destino: @php $requesterAddress = $entrega->pedidoTroca->requester->enderecos->first(); @endphp {{ $requesterAddress->bairro ?? 'Bairro N/A' }} @if ($requesterAddress->cidade ?? false) , {{ $requesterAddress->cidade }} @endif

Custo: R$ {{ number_format($entrega->custo_entrega ?? 0, 2, ',', '.') }}

Pagamento: {{ ucfirst(str_replace('_', ' ', $entrega->metodo_pagamento ?? 'N/A')) }}

Criado em: {{ \Carbon\Carbon::parse($entrega->created_at)->format('d/m/Y H:i') }}

{{-- You would define a route for Entrega details here --}} Ver Detalhes
@empty

@if($status) Nenhuma entrega com o status "{{ ucfirst(str_replace('_', ' ', $status)) }}" para exibir. @else Nenhuma entrega em andamento para exibir. @endif

Mantenha-se ativo para ver novas entregas!

@endforelse
{{ $entregas->links() }}
@endsection