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

<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">Community Inquiries</h1>
            <p class="text-sm text-gray-500 mt-1">Review and respond to messages from the community.</p>
        </div>
        <div class="flex gap-2 p-1 bg-gray-100 rounded-lg">
            <button wire:click="$set('filter', 'all')" class="px-4 py-1.5 text-xs font-semibold rounded-md <?php echo e($filter === 'all' ? 'bg-white shadow-sm' : 'text-gray-500 hover:text-gray-700'); ?> transition-all">All</button>
            <button wire:click="$set('filter', 'unread')" class="px-4 py-1.5 text-xs font-semibold rounded-md <?php echo e($filter === 'unread' ? 'bg-white shadow-sm' : 'text-gray-500 hover:text-gray-700'); ?> transition-all">Unread</button>
            <button wire:click="$set('filter', 'archive')" class="px-4 py-1.5 text-xs font-semibold rounded-md <?php echo e($filter === 'archive' ? 'bg-white shadow-sm' : 'text-gray-500 hover:text-gray-700'); ?> transition-all">Archive</button>
        </div>
    </header>

    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(session()->has('message')): ?>
        <div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded relative mb-4" role="alert">
            <span class="block sm:inline"><?php echo e(session('message')); ?></span>
        </div>
    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

    <div class="card">
        <div class="overflow-x-auto">
            <table>
                <thead>
                    <tr>
                        <th class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Sender</th>
                        <th class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Subject</th>
                        <th class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
                        <th class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
                        <th class="px-6 py-3 bg-gray-50 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
                    </tr>
                </thead>
                <tbody class="bg-white divide-y divide-gray-200">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $inquiries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $inquiry): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoop($loop->index); ?><?php endif; ?>
                        <tr class="<?php echo e($inquiry->status === 'new' ? 'bg-sage/5' : ''); ?>">
                            <td class="px-6 py-4 whitespace-nowrap">
                                <div class="font-semibold text-gray-900 text-sm"><?php echo e($inquiry->name); ?></div>
                                <div class="text-[11px] text-gray-400"><?php echo e($inquiry->email); ?></div>
                            </td>
                            <td class="px-6 py-4 max-w-[300px]">
                                <div class="font-semibold truncate text-sm text-gray-900"><?php echo e($inquiry->subject); ?></div>
                                <div class="text-[11px] text-gray-400 truncate italic">"<?php echo e(Str::limit($inquiry->message, 50)); ?>"</div>
                            </td>
                            <td class="px-6 py-4 whitespace-nowrap text-xs text-gray-500"><?php echo e($inquiry->created_at->format('M d, Y')); ?></td>
                            <td class="px-6 py-4 whitespace-nowrap text-sm">
                                <span class="status-badge <?php echo e($inquiry->status === 'new' ? 'pending' : ($inquiry->status === 'replied' ? 'success' : 'secondary')); ?>">
                                    <?php echo e(ucfirst($inquiry->status)); ?>

                                </span>
                            </td>
                            <td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
                                <a href="<?php echo e(route('admin.inquiries.view', $inquiry->id)); ?>" wire:navigate class="text-sage font-semibold text-xs px-2" style="color: #99BC85;">Read</a>
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($inquiry->status !== 'archived'): ?>
                                    <button wire:click="archive(<?php echo e($inquiry->id); ?>)" wire:loading.attr="disabled" class="text-gray-400 font-semibold text-xs px-2">Archive</button>
                                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                            </td>
                        </tr>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                        <tr>
                            <td colspan="5" class="px-6 py-4 text-center text-gray-500 text-sm">No inquiries found.</td>
                        </tr>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </tbody>
            </table>
        </div>
    </div>
</div><?php /**PATH D:\02-my freelance\00-DR_Padhi\DR_PADHI\storage\framework/views/livewire/views/5b024108.blade.php ENDPATH**/ ?>