<?php

namespace App\Livewire\Deudores;

use App\Models\Deudor;
use Livewire\Component;

class DeudorDetail extends Component
{
    public Deudor $deudor;

    public function mount($deudorId)
    {
        $this->deudor = Deudor::with([
                'procesos.cliente',
                'casosPrejuridicos.clienteCorporativo',
            ])
            ->findOrFail($deudorId);
    }

    public function render()
    {
        return view('livewire.deudores.deudor-detail', [
            'procesos' => $this->deudor->procesos,
            'casosPrejuridicos' => $this->deudor->casosPrejuridicos,
        ]);
    }
}
