<div class="no-break">
    <table style="width: 100%; border-top: 1px solid #000; border: 1px solid #000; border-collapse: collapse; ">

        <tr>
            <td style="text-align: center; margin-top: 5px;">
                <h2 style=" text-transform: uppercase; text-align: center; margin: 0;">
                    Analisa Unit
                </h2>

            </td>
        </tr>
    </table>
    <table style="width: 100%;">
        <tr>
            @php
                $cekLuas =
                    old('luas_unit_radio') ??
                    (isset($forminspeksi['luas_unit']['tidak sesuai']) ? 'tidak sesuai' : 'sesuai');

                $luasSesuai = $forminspeksi['luas_unit']['sesuai'] ?? null;
                $luasTidakSesuai = $forminspeksi['luas_unit']['tidak sesuai'] ?? null;
            @endphp
            <td width="20%" style="padding: 2px;">Luas Unit</td>
            <td width="1%" style="padding: 2px;"> :</td>
            <td width="79%" style="text-align: left">
                <table>
                    <tr>
                        <td>
                            <label>
                                <input type="radio" name="luas_tanah_radio" value="sesuai"
                                    {{ $cekLuas == 'sesuai' ? 'checked' : '' }}>
                                Sesuai {{ $luasSesuai ? '- ' . $luasSesuai . ' m²' : '' }}
                            </label>
                        </td>
                        <td>
                            <label>
                                <input type="radio" name="luas_tanah_radio" value="tidak sesuai"
                                    {{ $cekLuas == 'tidak sesuai' ? 'checked' : '' }}>
                                Tidak Sesuai {{ $luasTidakSesuai ? '- ' . $luasTidakSesuai . ' m² (luas fisik)' : '' }}
                            </label>
                        </td>
                    </tr>
                </table>
            </td>

        </tr>
        <tr>
            <td>Bentuk Unit</td>
            <td> :</td>
            <td>
                @if (isset($basicData['bentukUnit']))
                    <table class="checkbox-list">
                        <tr>
                            @foreach ($basicData['bentukUnit'] as $index => $item)
                                @if ($index % 3 == 0 && $index > 0)
                        </tr>
                        <tr>
                @endif
            <td class="checkbox-item">
                <label class="checkbox-label">
                    <input type="checkbox"
                        {{ isset($forminspeksi['bentuk_unit']) && in_array($item->name, $forminspeksi['bentuk_unit']) ? 'checked' : '' }}>
                    {{ $item->name }}
                </label>
            </td>
            @endforeach
        </tr>
    </table>
    @endif

    <tr>
        <td>Kondisi Unit</td>
        <td> :</td>
        <td>
            @if (isset($basicData['kondisiUnit']))
                <table class="checkbox-list">
                    <tr>
                        @foreach ($basicData['kondisiUnit'] as $index => $item)
                            @if ($index % 3 == 0 && $index > 0)
                    </tr>
                    <tr>
            @endif
        <td class="checkbox-item">
            <label class="checkbox-label">
                <input type="checkbox"
                    {{ isset($forminspeksi['kondisi_unit']) && in_array($item->name, $forminspeksi['kondisi_unit']) ? 'checked' : '' }}>
                {{ $item->name }}
            </label>
        </td>
        @endforeach
    </tr>
    </table>
    @endif
    <tr>
        <td>Posisi Unit</td>
        <td> :</td>
        <td>
            @if (isset($basicData['posisiUnit']))
                <table class="checkbox-list">
                    <tr>
                        @foreach ($basicData['posisiUnit'] as $index => $item)
                            @if ($index % 3 == 0 && $index > 0)
                    </tr>
                    <tr>
            @endif
        <td class="checkbox-item">
            <label class="checkbox-label">
                <input type="checkbox"
                    {{ isset($forminspeksi['posisi_unit']) && in_array($item->name, $forminspeksi['posisi_unit']) ? 'checked' : '' }}>
                {{ $item->name }}
            </label>
        </td>
        @endforeach
    </tr>
    </table>
    @endif
    <tr>
        <td>View Unit</td>
        <td> :</td>
        <td>
            @if (isset($basicData['view']))
                <table class="checkbox-list">
                    <tr>
                        @foreach ($basicData['view'] as $index => $item)
                            @if ($index % 3 == 0 && $index > 0)
                    </tr>
                    <tr>
            @endif
        <td class="checkbox-item">
            <label class="checkbox-label">
                <input type="checkbox"
                    {{ isset($forminspeksi['view']) && in_array($item->name, $forminspeksi['view']) ? 'checked' : '' }}>
                {{ $item->name }}
            </label>
        </td>
        @endforeach
    </tr>
    </table>
    @endif
    </table>
</div>
