@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">Car Show Winners</h2>
            </div>
        </div>
    </div>
</div>
<div class="page-body">
    <div class="container-xl">
        <div class="row row-cards">
            <div class="col-12">
                <div class="card">
                    <div class="table-responsive">
                        <table class="table table-vcenter card-table">
                            <thead>
                                <tr>
                                    <th>Category</th>
                                    <th>Place</th>
                                    <th>#</th>
                                    <th>Owner</th>
                                    <th>Year</th>
                                    <th>Make</th>
                                    <th>Model</th>
                                </tr>
                            </thead>
                            <tbody>
                                @foreach($winners as $winner)
                                    <tr>
                                        <td>{{ $winner->awardCategory->category_name }}</td>
                                        <td>{{ $winner->place }}</td>
                                        <td>{{ $winner->awardVehicle->owner }}</td>
                                        <td>{{ $winner->awardVehicle->vehicleOwner->bidder_fname ?? '' }} {{ $winner->awardVehicle->vehicleOwner->bidder_lname ?? '' }}</td>
                                        <td>{{ $winner->awardVehicle->year }}</td>
                                        <td>{{ $winner->awardVehicle->make }}</td>
                                        <td>{{ $winner->awardVehicle->model }}</td>
                                    </tr>
                                @endforeach
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
@push('js')
@endpush
