<?php

namespace App\Livewire\Inspections;

use App\Models\VehicleInspection;
use Livewire\Component;

class InspectionPrint extends Component
{
    public VehicleInspection $inspection;

    public $jobCard;

    public function mount(VehicleInspection $inspection)
    {
        $this->inspection = $inspection->load(['jobCard.customer', 'jobCard.vehicle', 'jobCard.branch', 'inspector']);
        $this->jobCard = $this->inspection->jobCard;
    }

    public function render()
    {
        return view('livewire.inspections.print')
            ->layout('components.layouts.print', ['title' => 'Vehicle Inspection Report - '.$this->jobCard->job_card_number]);
    }
}
