<?php

namespace App\Livewire\Diagnosis;

use App\Models\Diagnosis;
use Livewire\Component;

class Show extends Component
{
    public Diagnosis $diagnosis;

    public function mount(Diagnosis $diagnosis)
    {
        $this->diagnosis = $diagnosis->load([
            'jobCard.customer',
            'jobCard.vehicle',
            'serviceCoordinator',
            'estimate'
        ]);
    }

    public function createEstimate()
    {
        return redirect()->route('estimates.create', $this->diagnosis);
    }

    public function render()
    {
        return view('livewire.diagnosis.show');
    }
}
