<div class="no-break">
<table style="width: 100%">
    @if($permohonan->is_mig)
        @if (!empty($forminspeksi['fakta']['keterangan']))
            @foreach ($forminspeksi['fakta']['keterangan'] as $key => $item)
                <table class="judul"  style="width: 100%; ">
                    <tr>
                        <td style="width: 100%; border: 1px solid #000; text-align: center;">
                            {{ $key }}
                        </td>
                    </tr>
                </table>
                <table class="judul"  style="width: 100%; ">
                    <tr>
                        <td style="width: 100%; text-align: left;">
                            @if (is_array($item))
                                @foreach ($item as $data_)
                                    {!! nl2br(e($data_)) !!}<br>
                                @endforeach
                            @else
                                {!! nl2br(e($item)) !!}
                            @endif
                        </td>
                    </tr>
                </table>
            @endforeach
        @endif

        @if (!empty($forminspeksi['fakta']['saran']))
            @foreach ($forminspeksi['fakta']['saran'] as $key => $item)
                <table class="judul"  style="width: 100%; ">
                    <tr>
                        <td style="width: 100%; border: 1px solid #000; text-align: center;">
                            SARAN
                        </td>
                    </tr>
                </table>
                <table class="judul"  style="width: 100%; ">
                    <tr>
                        <td style="width: 100%; text-align: left;">
                            @if (is_array($item))
                                @foreach ($item as $data_)
                                    {!! nl2br(e($data_)) !!}<br>
                                @endforeach
                            @else
                                {!! nl2br(e($item)) !!}
                            @endif
                        </td>
                    </tr>
                </table>
            @endforeach
        @endif
    @else
        <tr>
        <td width="25%" style="vertical-align: top;">Informasi Dinas Tata Ruang
        </td>
        <td width="1%" style="vertical-align: top;">:</td>
        <td style="vertical-align: top;">
            @php
                $informasi = [
                    'peruntukan',
                    'kdb',
                    'kdh',
                    'gsb',
                    'max_lantai',
                    'klb',
                    'gss',
                    'pelebaran_jalan',
                    'nama_petugas',
                ];
            @endphp

            @foreach ($informasi as $key)
                @if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-')
                    @php
                        $displayKey = ucfirst(str_replace('_', ' ', $key));
                        if (strlen($key) == 3) {
                            $displayKey = strtoupper($key);
                        }
                    @endphp
                    <p> - {{ $displayKey }}: {{ $forminspeksi['fakta'][$key] }}</p>
                @endif
            @endforeach

        </td>
    </tr>

    @endif
</table>
</div>
