@extends('layouts.motoboy_dashboard') @section('content')
{{-- ADJUSTED MAIN TITLE HERE based on "Pedidos de Entrega Disponíveis" --}}

{{ $title }}

{{-- END ADJUSTED MAIN TITLE --}}
Usuário: {{ auth()->user()->name }}
Perfil: {{ optional(auth()->user()->roles()->first())->name ?? 'Sem perfil' }}
{{-- This subtitle is fine, indicating actions --}}

Pedidos de Entrega Aguardando Seu Aceite

{{-- ADJUSTED LOOP VARIABLE FROM $entregasConcluidas TO $entregas --}} @forelse($entregas as $entrega)
Cod. Troca:

{{ optional($entrega->pedidoTroca)->codigo_troca ?? 'N/A' }}

Pendente Aceitação

Medicamento: {{ optional(optional($entrega->pedidoTroca)->medicamento)->name ?? 'Desconhecido' }}

Origem: {{ optional($entrega->enderecoOrigem)->bairro ?? 'Bairro N/A' }} @if (optional($entrega->enderecoOrigem)->cidade ?? false) , {{ $entrega->enderecoOrigem->cidade }} - {{ optional($entrega->enderecoOrigem)->uf ?? 'N/A' }} @endif

Destino: {{ optional($entrega->enderecoDestino)->bairro ?? 'Bairro N/A' }} @if (optional($entrega->enderecoDestino)->cidade ?? false) , {{ $entrega->enderecoDestino->cidade }} - {{ optional($entrega->enderecoDestino)->uf ?? 'N/A' }} @endif

Data Criação: {{ \Carbon\Carbon::parse($entrega->created_at)->format('d/m/Y H:i') }}

Custo Sugerido: {{-- Assuming formatted_custo_entrega is an accessor in your Entrega model --}} {{ $entrega->formatted_custo_entrega ?? 'N/A' }}

Detalhes {{-- Form to accept the delivery --}}
@csrf
@empty

🎉 Nenhuma entrega pendente de aceite no momento!

Fique atento, novas oportunidades podem surgir a qualquer instante.

@endforelse
{{-- ADJUSTED PAGINATION VARIABLE FROM $entregasConcluidas TO $entregas --}} {{ $entregas->links() }}
@endsection @section('scripts') {{-- Include SweetAlert2 as per your dashboard blade --}} @endsection