<div>
    @php use Carbon\Carbon;  @endphp

    <div id="overlaySpinner" wire:loading>
        <div class="cv-spinner">
            <span class="spinner"></span>
        </div>
    </div>

    <div class="col-12">
        @if(!is_null($humans))
            <div class="row">
                <x-adminlte-card theme="lightblue" theme-mode="outline">
                    <div>
                        <small>Returned: </small>
                        <strong>{{ $search_count }} Record(s)</strong>
                    </div>
                </x-adminlte-card>
            </div>
        @endif

        @if(!is_null($humans))
            @php
                $headings = [
                    'ID number',
                    'Serial number',
                    'First name',
                    'Other names',
                    'Sur name',
                    'Nationality',
                    'Gender',
                    'Date of birth',
                    'Action'
                ];
                $count=0;
            @endphp
            <x-adminlte-card>
                <x-adminlte-datatable id="clients-table searchResultsCard" :heads="$headings" striped hoverable bordered>
                    @foreach($humans as $human)
                            <tr>
                                <td><h5 class="text-black">{{ $human['o_pid'] ?? '-' }}</h5></td>
                                <td><h5 class="text-info">{{ $human['serial_num'] ?? '-' }}</h5></td>
                                <td>{{ $human['name'] ?? '-' }}</td>
                                <td>{{ $human['last_name'] ?? '-' }}</td>
                                <td>{{ $human['surn'] ?? '-' }}</td>
                                <td>KENYAN <span class="fi fi-ke" style="font-size: 1rem;"></span></td>
                                <td>{{ $human['sex'] ?? '-' }}</td>
                                <td>
                                    {{ Carbon::parse($human['date_birth'])->format("d-m-Y") ?? '-' }}
                                </td>
                                <td>
                                    <x-adminlte-button
                                        label="Details"
                                        theme="info"
                                        icon="fas fa-info-circle"
                                    />
                                </td>
                            </tr>
                            @php $count++; @endphp
                    @endforeach

                </x-adminlte-datatable>
            </x-adminlte-card>
        @endif

    </div >
</div>

