Edit File: comment-index.blade.php
<div> @if (session('status')) <x-alert :status="session('status')" :message="session('message')" /> @endif <x-slot name="header"> <di class="relative"> <h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight text-center"> {{ __('Comment List') }} </h2> </di> </x-slot> <div class="py-12"> <div class=" mx-auto sm:px-6 lg:px-8"> <button wire:click="toggleImportant" class="{{$important ? "bg-red-600 text-white" : "bg-white text-black" }} rounded-lg font-white border-2 border-black my-4 text-center px-10 py-2">IMPORTANT</button> <div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg text-sm lg:text-base"> @if (count($comments) == 0) <h1 class="text-center text-3xl p-8">Tidak Ada Komentar</h1> @else <x-display-table :columns="['username / name', 'anime / video', 'komentar','actions']" routeName="admin.comment"> @foreach ($comments as $comment) @if ($important) @if($comment->is_urgent) <tbody> <tr> <td class="text-center py-2">{{$comment->user->username}} / {{$comment->user->name}}</td> <td class="text-center py-2">{{$comment->video_id ? $comment->video->name : $comment->anime->title}}</td> <td class="text-center py-2 line-clamp-3 break-all max-w-xl mx-auto">{{$comment->description}}</td> <td class="text-center"><x-danger-button type="button" wire:click="delete({{$comment->id}})" wire:confirm="Are you sure?"> Delete </x-danger-button></td> </tr> </tbody> @endif @else <tbody> <tr> <td class="text-center py-2">{{$comment->user->username}} / {{$comment->user->name}}</td> <td class="text-center py-2">{{$comment->video_id ? $comment->video->name : $comment->anime->title}}</td> <td class="text-center py-2 line-clamp-3 break-all max-w-xl mx-auto">{{$comment->description}}</td> <td class="text-center"><x-danger-button type="button" wire:click="delete({{$comment->id}})" wire:confirm="Are you sure?"> Delete </x-danger-button></td> </tr> </tbody> @endif @endforeach </x-display-table> @endif {{ $comments->links() }} </div> </div> </div> </div>
Back