@extends('layouts.admin')

@section('title', 'Verifikasi Petani')
@section('page-title', 'Daftar Verifikasi Petani')

@section('content')
<div class="card">
    <div class="card-header">
        <h4 class="card-title">Antrian Pendaftaran</h4>
    </div>
    <div class="card-body">
        <div class="table-responsive">
            <table class="table table-striped" id="table1">
                <thead>
                    <tr>
                        <th>No</th>
                        <th>Nama Petani</th>
                        <th>Nama Usaha</th>
                        <th>No HP</th>
                        <th>Status</th>
                        <th>Aksi</th>
                    </tr>
                </thead>
                <tbody>
                    @forelse($petanis as $petani)
                    <tr>
                        <td>{{ $loop->iteration }}</td>
                        <td>{{ $petani->nama_lengkap }}</td>
                        <td>{{ $petani->nama_usaha }}</td>
                        <td>{{ $petani->no_hp }}</td>
                        <td>
                            @if($petani->status_akun == 'menunggu')
                                <span class="badge bg-warning">Menunggu</span>
                            @elseif($petani->status_akun == 'aktif')
                                <span class="badge bg-success">Aktif</span>
                            @else
                                <span class="badge bg-danger">Ditolak</span>
                            @endif
                        </td>
                        <td>
                            {{-- Tombol Lihat Detail --}}
                            <a href="{{ url('admin/verifikasi/'.$petani->id) }}" class="btn btn-sm btn-primary">
                                Detail & Proses
                            </a>
                        </td>
                    </tr>
                    @empty
                    <tr>
                        <td colspan="6" class="text-center">Tidak ada antrian verifikasi saat ini.</td>
                    </tr>
                    @endforelse
                </tbody>
            </table>
        </div>
    </div>
</div>
@endsection