<dialog class="modal" :open="isDialogUnvalOpen">
    <template x-if="unvalAccessnumber">
    <div class="modal-box w-96">
        <h3 class="font-bold text-lg mb-4 text-warning">
            <i class="fa fa-exclamation-triangle mr-2"></i>Unvalidate Request
        </h3>
        <p class="text-sm mb-3" x-text="'Access Number: ' + unvalAccessnumber"></p>
        <textarea class="textarea textarea-bordered w-full" rows="4"
            x-model="unvalReason" placeholder="Enter reason for unvalidation..."></textarea>
        <p class='text-right mt-3'>
            <button class="btn btn-sm btn-ghost" @click="closeUnvalDialog()">Cancel</button>
            <?php if (session()->get('userlevel') <= 1): ?>
            <button id="unvalidate-btn" class="btn btn-sm btn-warning"
                @click="unvalidate(unvalAccessnumber, '<?=session('userid');?>')"
                :disabled="!unvalReason.trim()">
                <span class="text-error font-bold">UnVal</span>
            </button>
            <?php endif; ?>
        </p>
    </div>
    </template>
</dialog>
