<?php
use Livewire\Component;
use App\Models\Faq;
?>

<div class="max-content">
    <header class="flex justify-between items-center mb-10">
        <div>
            <h1 class="text-2xl font-semibold tracking-tight text-gray-900">Edit FAQ</h1>
            <p class="text-sm text-gray-500 mt-1">Updating: "<?php echo e($question); ?>"</p>
        </div>
        <a href="<?php echo e(route('admin.faqs')); ?>" wire:navigate class="btn-secondary text-xs">Back to FAQs</a>
    </header>

    <form wire:submit.prevent="save" class="space-y-8">
        <div class="card p-8 space-y-6">
            <div>
                <label class="block text-[11px] font-bold text-gray-500 uppercase mb-2">Question</label>
                <input type="text" wire:model="question" class="input-field w-full text-lg font-medium" required>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__errorArgs = ['question'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-red-500 text-xs mt-1"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </div>

            <div>
                <label class="block text-[11px] font-bold text-gray-500 uppercase mb-2">Answer</label>
                <textarea wire:model="answer" rows="6" class="input-field w-full resize-none text-base" required></textarea>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__errorArgs = ['answer'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-red-500 text-xs mt-1"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </div>

            <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                <div>
                    <label class="block text-[11px] font-bold text-gray-500 uppercase mb-2">Display Order</label>
                    <input type="number" wire:model="sort_order" class="input-field w-full">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__errorArgs = ['sort_order'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-red-500 text-xs mt-1"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </div>
                <div>
                    <label class="block text-[11px] font-bold text-gray-500 uppercase mb-2">Status</label>
                    <select wire:model="status" class="input-field w-full">
                        <option value="published">Published</option>
                        <option value="draft">Draft</option>
                    </select>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__errorArgs = ['status'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-red-500 text-xs mt-1"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </div>
            </div>
        </div>

        <div class="flex justify-between items-center pb-12">
            <button type="button" wire:click="delete" wire:confirm="Are you sure?" wire:loading.attr="disabled" class="text-red-500 font-semibold text-xs uppercase tracking-widest hover:underline">
                <span wire:loading.remove wire:target="delete">Delete FAQ</span>
                <span wire:loading wire:target="delete">Deleting...</span>
            </button>
            <div class="flex gap-3">
                <a href="<?php echo e(route('admin.faqs')); ?>" wire:navigate class="px-8 py-2 border border-gray-300 text-gray-700 text-sm font-medium rounded-md hover:bg-gray-50 transition-colors">Discard</a>
                <button type="submit" wire:loading.attr="disabled" class="px-10 py-2 bg-sage text-white text-sm font-medium rounded-md hover:bg-sage-dark transition-colors" style="background-color: #99BC85;">
                    <span wire:loading.remove wire:target="save">Update FAQ</span>
                    <span wire:loading wire:target="save">Updating...</span>
                </button>
            </div>
        </div>
    </form>
</div><?php /**PATH D:\02-my freelance\00-DR_Padhi\DR_PADHI\storage\framework/views/livewire/views/daebb14d.blade.php ENDPATH**/ ?>