@extends('layouts.admin')
@section('title', 'Destination Management')
@section('content')
<div class="flex justify-between items-center mb-6">
<h1 class="text-2xl font-semibold text-gray-800">Destination Management</h1>
<a href="{{ route('admin.destinations.create') }}" class="bg-blue-600 text-white px-4 py-2 rounded-lg">Add Destination</a>
</div>
<div class="bg-white rounded-lg shadow overflow-hidden">
<table class="min-w-full">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Name</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Slug</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Is featured</th>
<th class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
@foreach($destinations as $destination)
<tr>
<td class="px-6 py-4 whitespace-nowrap">{{ $destination->name }}</td>
<td class="px-6 py-4 whitespace-nowrap">{{ $destination->slug }}</td>
<td class="px-6 py-4 whitespace-nowrap">{{ $destination->is_featured }}</td>
<td class="px-6 py-4 whitespace-nowrap text-right">
<a href="{{ route('admin.destinations.edit', $destination) }}" class="text-blue-600 hover:text-blue-900 mr-3">Edit</a>
<form action="{{ route('admin.destinations.destroy', $destination) }}" method="POST" class="inline-block" onsubmit="return confirm('Are you sure?')">
@csrf
@method('DELETE')
<button type="submit" class="text-red-600 hover:text-red-900">Delete</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="p-4">
{{ $destinations->links() }}
</div>
</div>
@endsection