@extends('layouts.app')

@section('title', __('vrc::lang.service_history'))

@section('content')
<section class="content-header">
    <h1>@lang('vrc::lang.service_history') — {{ $vehicle->label }}</h1>
</section>

<section class="content">
    @component('components.widget', ['class' => 'box-primary'])
        <table class="table table-bordered table-striped">
            <thead>
                <tr>
                    <th>@lang('vrc::lang.repair_order')</th>
                    <th>@lang('vrc::lang.status')</th>
                    <th>@lang('messages.date')</th>
                    <th>@lang('vrc::lang.grand_total')</th>
                </tr>
            </thead>
            <tbody>
                @forelse ($orders as $ro)
                    <tr>
                        <td>{{ $ro->number ?? ('#' . $ro->id) }}</td>
                        <td>{{ $ro->status }}</td>
                        <td>{{ optional($ro->created_at)->format('Y-m-d') }}</td>
                        <td>{{ $ro->grand_total ?? '—' }}</td>
                    </tr>
                @empty
                    <tr><td colspan="4" class="text-center text-muted">@lang('vrc::lang.no_service_history')</td></tr>
                @endforelse
            </tbody>
        </table>
    @endcomponent
</section>
@endsection
