@extends('tablar::page')

@section('content')
<div class="page-header d-print-none">
    <div class="container-xl">
        <div class="row g-2 align-items-center">
            <div class="col">
                <h2 class="page-title">Show Car List</h2>
            </div>
        </div>
    </div>
</div>
<div class="page-body">
    <div class="container-xl">
        <div class="card">
            <div class="table-responsive">
                <table class="table table-vcenter card-table" id="showcars-table">
                    <thead>
                        <tr>
                            <th class="sort" data-sort="bidder-num">Bidder #</th>
                            <th class="sort" data-sort="make">Make</th>
                            <th class="sort" data-sort="model">Model</th>
                            <th class="sort" data-sort="year">Year</th>
                            <th class="sort" data-sort="owner">Owner</th>
                        </tr>
                    </thead>
                    <tbody class="list">
                        @foreach($showcarlist_results as $vehicle)
                            <tr>
                                <td class="bidder-num">{{ $vehicle->bidder_assigned_number ?? 'N/A' }}</td>
                                <td class="make">{{ $vehicle->make }}</td>
                                <td class="model">{{ $vehicle->model }}</td>
                                <td class="year">{{ $vehicle->year }}</td>
                                <td class="owner">{{ $vehicle->bidder_fname }} {{ $vehicle->bidder_lname }}</td>
                            </tr>
                        @endforeach
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
@endsection

@section('js')
<script src="https://cdnjs.cloudflare.com/ajax/libs/list.js/2.3.1/list.min.js"></script>
<script>
    new List('showcars-table', {
        valueNames: ['bidder-num', 'make', 'model', 'year', 'owner']
    });
</script>
@endsection
@push('js')
@endpush
