@extends('layouts.admin')
@section('title', 'Feature Management')
@section('content')
<div class="flex justify-between items-center mb-6">
<h1 class="text-2xl font-semibold text-gray-800">Feature Management</h1>
<a href="{{ route('admin.features.create') }}" class="bg-blue-600 text-white px-4 py-2 rounded-lg">Add Feature</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">Title</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Icon</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Is active</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($features as $feature)
<tr>
<td class="px-6 py-4 whitespace-nowrap">{{ $feature->title }}</td>
<td class="px-6 py-4 whitespace-nowrap">{{ $feature->icon }}</td>
<td class="px-6 py-4 whitespace-nowrap">{{ $feature->is_active }}</td>
<td class="px-6 py-4 whitespace-nowrap text-right">
<a href="{{ route('admin.features.edit', $feature) }}" class="text-blue-600 hover:text-blue-900 mr-3">Edit</a>
<form action="{{ route('admin.features.destroy', $feature) }}" 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">
{{ $features->links() }}
</div>
</div>
@endsection