<div class=" p-4">
    <div class="max-w-full mx-auto bg-white rounded-lg">
        <!-- Header -->
        <div class="text-black p-4 rounded-t-lg flex justify-between items-center">
            <h1 class="text-lg font-semibold">{{ $company }} (SN={{ $serverKey }}):: Onload Condition</h1>
            <button class="bg-info hover:info-focus text-white font-bold py-2 px-4 rounded">
                Export Query
            </button>
        </div>

        <!-- Table Section -->
        <div class="overflow-x-auto p-4">
           <table aria-describedby="mydesc"  class="min-w-full bg-white border border-gray-300">
                <thead>
                    <tr class="bg-slate-300 text-gray-700">
                        <th scope="col"  class="py-2 px-4 border-b">Serverkey</th>
                        <th scope="col"  class="py-2 px-4 border-b">Service Name</th>
                        <th scope="col"  class="py-2 px-4 border-b">Action</th>
                        <th scope="col"  class="py-2 px-4 border-b">Onload Code</th>
                    </tr>
                </thead>
                <tbody>
                    @if (count($onloadList) > 0)
                
                        @foreach ($onloadList['SKEY'] as $index => $onload)
                        <tr class="border-b">
                            <td class="py-2 px-4 border w-32">
                                <input type="text" class="w-full p-2 border border-gray-300 rounded-md" wire:model.defer="onloadList.SKEY.{{ $index }}" />
                            </td>
                            <td class="py-2 px-4 border w-48">
                                <input type="text" class="w-full p-2 border border-gray-300 rounded-md" wire:model.defer="onloadList.SERVNAME.{{ $index }}" />
                            </td>
                           
                            <td class="py-2 px-4 border w-32">
                                <input type="text" class="w-full p-2 border border-gray-300 rounded-md" wire:model.defer="onloadList.ACT.{{ $index }}" />
                            </td>
                            <td class="py-2 px-4 border w-64">
                                <textarea class="w-full p-1 border rounded" wire:model.defer="onloadList.ONLOAD.{{ $index }}"></textarea>
                            </td>
                        </tr>
                        @endforeach
                    @endif
                </tbody>
            </table>
            <div class="p-4">
                <button wire:click="saveOnload"
                    class="bg-primary hover:bg-primary-focus text-white font-bold py-2 px-4 rounded">
                    Save
                </button>
            </div>
        </div>
    </div>
</div>
