@extends('layouts.treasury') @section('breadcrumb') ` @endsection @section('content')

{{ tr('sender_details') }}

@include('treasury.senders.actions', ['sender' => $sender])
@php $fields = [ ['first_name', 'ri-user-line', $sender->title . " " . $sender->first_name], ['middle_name', 'ri-user-line', $sender->middle_name], ['last_name', 'ri-user-line', $sender->last_name], ['email', 'ri-mail-line', $sender->email], ['mobile_country_code', 'ri-phone-line', $sender->mobile_country_code], ['mobile', 'ri-smartphone-line', $sender->mobile], ['dob', 'ri-calendar-line', common_date($sender->dob, auth('treasury')->user()->timezone, 'd M Y h:i A')], ['country', 'ri-map-pin-line', get_country($sender->country)], ['address_1', 'ri-road-map-line', $sender->address_1], ['address_2', 'ri-road-map-line', $sender->address_2], ['city', 'ri-building-line', $sender->city], ['state', 'ri-building-line', $sender->state], ['postal_code', 'ri-mail-send-line', $sender->postal_code], ['type', 'ri-list-check', $sender->type == USER_TYPE_INDIVIDUAL ? tr('individual') : tr('business')], ['id_type', 'ri-id-card-line', $sender->id_type], ['id_number', 'ri-hashtag', $sender->id_number], ['source_of_funds', 'ri-wallet-line', $sender->source_of_funds], ['status', 'ri-shield-check-line', sender_status_formatted($sender->status)], ['created_at', 'ri-time-line', common_date($sender->created_at, auth('treasury')->user()->timezone, 'd M Y h:i A')], ['updated_at', 'ri-refresh-line', common_date($sender->updated_at, auth('treasury')->user()->timezone, 'd M Y h:i A')], ]; $notEmpty = fn($v) => !($v === null || $v === '' || $v === []); @endphp
@foreach ($fields as $field) @if ($notEmpty($field[2]))
{{ tr($field[0]) }}
{{ $field[2] ?: tr('na') }}
@endif @endforeach
@if ($sender->business_persons)

{{ tr('business_person_details') }}

@php $iconMap = [ 'first_name' => 'ri-user-line', 'last_name' => 'ri-user-line', 'dob' => 'ri-calendar-event-line', 'email' => 'ri-mail-line', 'mobile_country_code' => 'ri-phone-line', 'mobile' => 'ri-smartphone-line', 'id_type' => 'ri-id-card-line', 'id_number' => 'ri-fingerprint-line', 'address_1' => 'ri-home-4-line', 'city' => 'ri-building-2-line', 'state' => 'ri-map-pin-2-line', 'postal_code' => 'ri-map-pin-line', 'country' => 'ri-flag-line', ]; @endphp @foreach ($sender->business_persons as $person)
{{ $person['first_name'] ?? '' }} {{ $person['last_name'] ?? '' }}
@foreach ($person as $key => $value) @if (!empty($value))
{{ tr($key) }}
{{ $value }}
@endif @endforeach
@endforeach
@endif @if ($sender->documents) @php $documentIconMap = [ 'document_country' => 'ri-earth-line', 'document_name' => 'ri-file-text-line', 'document_type' => 'ri-file-2-line', 'document_file' => 'ri-attachment-line', ]; $allowedFields = ['document_country', 'document_name', 'document_type', 'document_file']; @endphp

{{ tr('documents') }}

@foreach ($sender->documents as $document)
{{ $document->document_name ?? tr('na') }}
@foreach ($allowedFields as $key) @php $value = $document->{$key} ?? null; @endphp @if (!empty($value))
{{ tr($key) }}
@if ($key === 'document_file') {!! filePreview($value) !!} @else {{ $value }} @endif
@endif @endforeach
@endforeach
@endif
@endsection