@php
    use App\Helpers\DateHelper;

    $documentTypes = [
        1 => "Carta d'Identità",
        2 => 'Patente',
        3 => 'Passaporto',
        4 => 'Altro'
    ];

    $documentType = $documentTypes[$infortunato->documento_tipo] ?? '';
@endphp

<table class="striped-table">
    <tr>
        <td width="25%" class="veicolo-title-cell" style="padding-bottom:10px:none!important;">COGNOME E NOME:</td>
        <td width="25%" class="veicolo-content-cell" style="padding-bottom:10px:none!important;">
            {{ $infortunato->lastname }}
            {{ $infortunato->firstname }}
        </td>
        <td width="20%" class="veicolo-title-cell" style="padding-bottom:10px:none!important;">NATO A:</td>
        <td width="20%" class="veicolo-content-cell" style="padding-bottom:10px:none!important;">
            {{ optional($infortunato->birth_town_id_value)->name ?? 'N/A' }}
        </td>
    </tr>
    <tr>
        <td width="25%" class="veicolo-title-cell" style="padding-bottom:10px:none!important;">NATO IL:</td>
        <td width="25%" class="veicolo-content-cell" style="padding-bottom:10px:none!important;">
            {{ (!empty($infortunato->birth_date) && Carbon\Carbon::parse($infortunato->birth_date)->year > 0) ? Carbon\Carbon::parse($infortunato->birth_date)->format('d/m/Y') : '-' }}
        </td>
        <td width="50%" class="veicolo-title-cell" style="padding-bottom:10px:none!important;"></td>
        <td width="50%" class="veicolo-title-cell" style="padding-bottom:10px:none!important;"></td>
    </tr>

    <tr>
        <td width="25%" class="veicolo-title-cell" style="padding-bottom:10px:none!important;">DOCUMENTO:</td>
        <td width="35%" class="veicolo-content-cell" style="padding-bottom:10px:none!important;">{{ $documentType }}</td>
        <td width="25%" class="veicolo-title-cell" style="padding-bottom:10px:none!important;">NUMERO:</td>
        <td width="25%" class="veicolo-content-cell" style="padding-bottom:10px:none!important;">
            {{ $infortunato->documento_numero }}
        </td>
    </tr>
    <tr>
        <td width="25%" class="veicolo-title-cell" style="padding-bottom:10px:none!important;">SEDICENTE:</td>
        <td width="25%" class="veicolo-content-cell" style="padding-bottom:10px:none!important;">
            {{ $infortunato->sedicente ? 'SI' : 'NO' }}
        </td>
        <td width="50%" class="veicolo-title-cell" style="padding-bottom:10px:none!important;"></td>
        <td width="50%" class="veicolo-title-cell" style="padding-bottom:10px:none!important;"></td>
    </tr>

    <tr>
        <td style="border:none!important;"></td>
    </tr>
</table>
