<div class="">
    <div class="max-w-6xl mx-auto bg-white rounded-lg">
        <!-- Header -->
        <div class=" text-black p-4 rounded-t-lg">
            <h1 class="text-lg font-semibold">{{ $company }} ( SNKEY = {{ $serverKey }} ) :: Organize</h1>
        </div>

        <!-- Form Section -->
        <div class="pt-2 px-4 pb-4 border-b">
            <label for="selectDateOrg" class="text-gray-700 font-semibold">Receive Data From SPN:</label>
            <select id="selectDateOrg" wire:model="selectDateOrg" class="ml-2 p-2 border border-gray-300 rounded-md">
                @if (isset($allDate))
                    @foreach ($allDate as $date)
                        <option value="{{ $date->id ?? '' }}">{{ $date->createDate ?? '' }}</option>
                    @endforeach
                @endif
            </select>
        </div>

        <!-- Table Section -->
        <div class="overflow-x-auto p-4">

           <table aria-describedby="mydesc"  class="min-w-full is-hoverable bg-white border border-gray-300 border-b ">
                <thead>
                    <tr class="bg-gray-200 text-gray-700">
                        <th scope="col"  class="py-2 px-4 border-b rounded-tl-lg">Organize</th>
                        <th scope="col"  class="py-2 px-4 border-b">Profile</th>
                        <th scope="col"  class="py-2 px-4 border-b rounded-tr-lg">Document Type</th>
                    </tr>
                </thead>
                <tbody>
                    @if (count($orgList) > 0)
                        @foreach ($orgList as $org)
                            <tr class="border-b  hover:bg-slate-300">
                                <td class="py-4 px-4 border-b text-left hover:bg-slate-300">
                                    <ul class="">
                                        <li><strong>Organize: {{ $org->spnOrganize?? ''}}</strong></li>
                                        <li>Last Update: {{ $org->epromotionCheckDate?? '' }}</li>
                                        <li>Team (e-promotion): {{ $org->epromotionSaleTeam?? '' }}</li>
                                        <li>Size (e-promotion): {{ $org->epromotionSize?? '' }}</li>
                                    </ul>
                                </td>
                                <td class="py-4 px-4 border-b text-left  ">
                                    <!-- Example Profile Data -->
                                    <ul class="list-disc">
                                        @if (count($org->profileList??[]) > 0)
                                            @foreach ($org->profileList as $profile)
                                                <li>{{ $profile->profileCode }}</li>
                                            @endforeach
                                        @endif
                                    </ul>
                                </td>
                                <td class="py-4 px-4 border-b text-left  ">
                                    <!-- Example Document Type Data -->
                                    <ul class="list-disc">
                                        @if (count($org->docTypeList??[]) > 0)
                                            @foreach ($org->docTypeList as $doc)
                                                <li>{{ $doc->DTDESC }}</li>
                                            @endforeach
                                        @endif
                                    </ul>
                                </td>
                            </tr>
                        @endforeach
                    @endif
                </tbody>
            </table>
        </div>
    </div>
</div>
