@extends('layouts.admin', ['title' => __('Services').' | Nivex'])

@section('content')
    <div class="mb-6 flex items-center justify-between gap-4">
        <h1 class="section-title text-4xl">{{ __('Services') }}</h1>
        <a href="{{ route('admin.services.create') }}" class="btn-primary">{{ __('Create New') }}</a>
    </div>
    <div class="admin-card overflow-x-auto">
        <table class="min-w-full text-left text-sm">
            <thead class="text-slate-400"><tr><th class="pb-4">Title</th><th class="pb-4">Order</th><th class="pb-4"></th></tr></thead>
            <tbody class="divide-y divide-slate-200 dark:divide-slate-800">
                @foreach ($services as $service)
                    <tr>
                        <td class="py-4">{{ $service->translate('title', 'en') }}</td>
                        <td class="py-4">{{ $service->sort_order }}</td>
                        <td class="py-4">
                            <div class="flex justify-end gap-3">
                                <a href="{{ route('admin.services.edit', $service) }}" class="btn-secondary px-4 py-2">{{ __('Edit') }}</a>
                                <form method="POST" action="{{ route('admin.services.destroy', $service) }}">@csrf @method('DELETE') <button class="btn-secondary px-4 py-2">{{ __('Delete') }}</button></form>
                            </div>
                        </td>
                    </tr>
                @endforeach
            </tbody>
        </table>
    </div>
@endsection