@php
    use App\Helpers\DateHelper;
@endphp

@if ($datiVeicolo->polizze > 0)
<style>
    .striped-table {
        width: 100%;
        border-collapse: collapse;
    }

    .striped-table th, .striped-table td {
        border: 1px solid #000;
        padding: 8px;
    }

    .striped-table tr:nth-child(even) {
        background-color: #f2f2f2;
    }

    .striped-table tr:nth-child(odd) {
        background-color: #fff;
    }
</style>

<table class="table-content striped-table" width="100%">
    <tr>
        <td width="20%" style="text-align: center; font-size: 20px;">
            <table class="">
                <tr class="tr-sub-title">
                    <td class="bold" style="border:none!important">ASSICURAZIONE</td>
                </tr>
            </table>
        </td>
        <td width="80%">
            <table class="striped-table" width="100%">
                <tr>
                    <td width="15%" class="veicolo-title-cell" style="padding-bottom: 10px !important;">COMPAGNIA:</td>
                    <td width="35%" class="veicolo-content-cell" style="padding-bottom: 10px !important;">
                        {{ $datiVeicolo?->polizza->compagnia->name ?? '' }}
                    </td>
                    <td width="15%" class="veicolo-title-cell" style="padding-bottom: 10px !important;">AGENZIA:</td>
                    <td width="35%" class="veicolo-content-cell" style="padding-bottom: 10px !important;">
                        {{ $datiVeicolo?->polizza->agenzia ?? '' }}
                    </td>
                </tr>
                <tr>
                    <td width="20%" class="veicolo-title-cell" style="padding-bottom: 10px !important;">NUMERO:</td>
                    <td width="30%" class="veicolo-content-cell" style="padding-bottom: 10px !important;">
                        {{ $datiVeicolo?->polizza->polizza_num ?? '' }}
                    </td>
                    <td width="50%" class="veicolo-title-cell" style="padding-bottom: 10px !important;"></td>
                    <td width="50%" class="veicolo-title-cell" style="padding-bottom: 10px !important;"></td>
                </tr>
                <tr>
                    <td width="20%" class="veicolo-title-cell" style="padding-bottom: 10px !important;">VALIDA DAL:</td>
                    <td width="30%" class="veicolo-content-cell" style="padding-bottom: 10px !important;">
                        @if($datiVeicolo && $datiVeicolo->polizza && $datiVeicolo->polizza->valida_dal)
                            {{ \Carbon\Carbon::parse($datiVeicolo->polizza->valida_dal)->format('d/m/Y') }}
                        @endif
                    </td>
                    <td width="20%" class="veicolo-title-cell" style="padding-bottom: 10px !important;">AL:</td>
                    <td width="30%" class="veicolo-content-cell" style="padding-bottom: 10px !important;">
                        @if($datiVeicolo && $datiVeicolo->polizza && $datiVeicolo->polizza->valida_al)
                            {{ \Carbon\Carbon::parse($datiVeicolo->polizza->valida_al)->format('d/m/Y') }}
                        @endif
                    </td>

                </tr>
            </table>
        </td>
    </tr>
</table>
@endif
