<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">ID</th>
                        <th scope="col"  class="py-2 px-4 border-b">Step</th>
                        <th scope="col"  class="py-2 px-4 border-b">Level</th>
                        <th scope="col"  class="py-2 px-4 border-b">Name</th>
                        <th scope="col"  class="py-2 px-4 border-b">Description</th>
                        <th scope="col"  class="py-2 px-4 border-b">Validate Code</th>
                        <th scope="col"  class="py-2 px-4 border-b">Doctype</th>
                        <th scope="col"  class="py-2 px-4 border-b">Active</th>
                    </tr>
                </thead>
                <tbody>
                    @if (count($validateList) > 0)
                
                        @foreach ($validateList['id'] as $index => $onload)
                        <tr class="border-b">
                            <td class="py-2 px-4 border w-24 text-center">{{ $index +1 }}</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="validateList.step.{{ $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="validateList.level.{{ $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="validateList.name.{{ $index }}" />
                            </td>
                            <td class="py-2 px-4 border w-64">
                                <textarea class="w-full p-1 border rounded" wire:model.defer="validateList.desc.{{ $index }}"></textarea>
                            </td>
                            <td class="py-2 px-4 border w-64">
                                <textarea class="w-full p-1 border rounded" wire:model.defer="validateList.validateCode.{{ $index }}"></textarea>
                            </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="validateList.doctype.{{ $index }}" />
                            </td>
                            <td class="py-2 px-4 border w-24">
                                <input type="text" class="w-full p-2 border border-gray-300 rounded-md" wire:model.defer="validateList.active.{{ $index }}" />
                            </td>
                        </tr>
                        @endforeach
                    @endif
                </tbody>
            </table>
            <div class="p-4">
                <button wire:click="saveValidate"
                    class="bg-primary hover:bg-primary-focus text-white font-bold py-2 px-4 rounded">
                    Save
                </button>
            </div>
        </div>
    </div>
</div>
