@php
    use App\Helpers\DateHelper;

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

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

<table>
    <tr>
        <td width="5%" class="veicolo-title-cell"></td>
        <td width="25%" class="veicolo-title-cell">COGNOME E NOME:</td>
        <td width="25%" class="veicolo-content-cell">
            {{ $infortunato->lastname }}
            {{ $infortunato->firstname }}
        </td>
        <td width="20%" class="veicolo-title-cell">NATO A:</td>
        <td width="20%" class="veicolo-content-cell">
            {{ optional($infortunato->birth_town_id_value)->name ?? 'N/A' }}
        </td>
    </tr>
    <tr>
        <td width="5%" class="veicolo-title-cell"></td>
        <td width="25%" class="veicolo-title-cell">NATO IL:</td>
        <td width="25%" class="veicolo-content-cell">
            {{ DateHelper::formatDate($infortunato->birth_date) }}
        </td>
    </tr>

    <tr>
        <td width="5%" class="veicolo-title-cell"></td>
        <td width="20%" class="veicolo-title-cell">DOCUMENTO:</td>
        <td width="20%" class="veicolo-content-cell">{{ $documentType }}</td>
        <td width="30%" class="veicolo-title-cell">NUMERO:</td>
        <td width="25%" class="veicolo-content-cell">
            {{ $infortunato->documento_numero }}
        </td>
    </tr>
    <tr>
        <td width="5%" class="veicolo-title-cell"></td>
        <td width="25%" class="veicolo-title-cell">SEDICENTE:</td>
        <td width="20%" class="veicolo-content-cell">
            {{ $infortunato->sedicente ? 'SI' : 'NO' }}
        </td>
    </tr>

    <tr>
        <td></td>
    </tr>
</table>
