<div>
    @include('livewire.user-management.top-nav.user-management')

    @if (session()->has('success'))
    <div
        x-data="{ show: true }"
        x-init="setTimeout(() => show = false, 3000)"
        x-show="show"
        x-transition
        class="text-2xl text-green-700 px-4 py-2 rounded mb-4">
        ✅ {{ session('success') }}
    </div>
    @endif



    <livewire:components.table
        :columns="[
            ['label' => 'Username', 'field' => 'username', 'type' => 'text'],
            ['label' => 'First Name', 'field' => 'firstname', 'type' => 'text'],
            ['label' => 'Last Name', 'field' => 'lastname', 'type' => 'text'],
            ['label' => 'Email', 'field' => 'email', 'type' => 'text'],
            ['label' => 'Role', 'field' => 'role', 'type' => 'select', 'options' => [
                                                                1 => 'Admin',
                                                                0 => 'Marketing Personnel'
                                                            ]],
            ['label' => 'Status', 'field' => 'status', 'type' => 'select', 'options' =>[
                                                                'active' => 'Active',
                                                                'inactive' => 'Inactive'
                                                            ]],
            ]"
        :rows="$users"
        :addRoute="route('user-create')"
        :hasAddButton="true"
        :hasCheckbox="true"
        :hasActions="true"
        :isViewPage="false"
        :rowKey="'admin_uuid'"
        :updateRoute="'/main/user-management/user-update'"
        :viewRoute="'/main/user-management/user-view'"
        :deleteEndpoint="'api/cms/admin'"
        :deleteAllEndpoint="'api/cms/adminBatchDelete'"
        
        />
</div>
