{{-- checkbox --}} {{-- title (flex, takes remaining space) --}} {{-- slug --}} {{-- checkbox --}} {{-- created at --}} {{-- status --}} {{-- actions --}} @php $currentSort = request()->query('sort', ''); $currentDir = request()->query('dir', ''); if (! in_array($currentDir, ['asc', 'desc'], true)) { $currentDir = ''; } $isEmpty = $data->isEmpty(); $sortIcon = function (string $col) use ($currentSort, $currentDir, $isEmpty) { if ($isEmpty) return ''; $active = $currentSort === $col; $upActive = $active && $currentDir === 'asc'; $downActive = $active && $currentDir === 'desc'; $upClass = $upActive ? 'text-white' : 'text-white/40'; $downClass = $downActive ? 'text-white' : 'text-white/40'; return sprintf( '', $upClass, $downClass ); }; @endphp {{-- Checkbox (select-all) --}} @if(!$isEmpty) @endif
{{ __('pages/admin/faq.table.question') }} {!! $sortIcon('question') !!}
{{ __('pages/admin/faq.table.answer') }}
{{ __('pages/admin/faq.table.order') }} {!! $sortIcon('order') !!}
{{ __('pages/admin/faq.table.status') }}
{{ __('pages/admin/faq.table.created_at') }}
{{ __('pages/admin/faq.table.actions') }}
@foreach($data as $item)
{{ Str::limit($item->question, 60) }}
{{ Str::limit(strip_tags($item->answer), 80) }}
{{ $item->order }} @if(!($isArchivedPage ?? false)) {{-- Interactive status dropdown (active faqs page only) --}} @foreach($statuses as $status) @endforeach @else {{-- Read-only badge on archived page --}} {{ $item->status_label }} @endif {{ $item->created_at?->format('M d, Y') }}
@if($isArchivedPage ?? false) {{-- Restore --}} @else {{-- Edit --}} {{-- Delete --}} @endif
@endforeach @if($data->isEmpty() && ($totalFaqs ?? 0) > 0)

{{ __('pages/admin/faq.no_data_available.title') }}

{{ __('pages/admin/faq.no_results_filtered') }}

{{ __('buttons.filter.clear') }}
@endif
{{ $data->links('components.ajax-pagination') }}