@php
    $authCheck = auth()->check();
    $permission= auth()->user();
@endphp
<table class="table table-striped">
                        <thead class="border-bottom">
                            <tr>
                                <th>S.No.</th>
                                <th>User name</th>
                                <th>Feedback Option</th>
                                <th>Rating</th>
                                <th>Message</th>
                                {{-- <th>Action</th>  --}}
                            </tr>
                        </thead>
                       
                        <tbody>
                            @foreach($feedbacks as $key => $feedback)
                            <tr>
                                <td>{{ $key + 1 }}</td>
                               
                                <td>{{ $feedback->user->name ?? '-'}}</td>

                               @php
                                    $optionNames = [];
                                    $oids = json_decode($feedback->oid, true);

                                    if (is_array($oids)) {
                                        foreach ($oids as $oid) {
                                            if (isset($allOptionNames[$oid]) && !empty($allOptionNames[$oid])) {
                                                $optionNames[] = $allOptionNames[$oid];
                                            }
                                        }
                                    }
                                @endphp
                                <td>{{ count($optionNames) ? implode(', ', $optionNames) : '-' }}</td>

                                <td>{{ $feedback->rating }}</td>
                              
                                <td>{{ Str::limit($feedback->message, 50) }}</td>
                                <!-- <td>{{ $feedback->message }}</td> -->
                            {{-- @if($authCheck && $permission->hasPermission('feedback-show'))
                                <td class="d-flex align-items-center">
                                    <div class="lights">
                                        <div class="mb-0 h-100">
                                            <a href="{{ route('admin.feedback.view', base64_encode($feedback->id)) }}" class="text-info" data-bs-toggle="tooltip" data-bs-placement="top" title="View"><i class="fa-solid fa-eye"></i></a>
                                        </div>
                                    </div>

                                   
                                </td>
                            @endif --}}
                            </tr>

                            @endforeach
                          
                        </tbody>
                    </table>

                     <!-- Pagination Links -->
                    <div class="pagination-wrapper mb-4">
                        {{ $feedbacks->links() }}
                    </div>
