<?php

namespace App\View\Components;

use Illuminate\View\Component;

class PatientForm extends Component
{
    public $patient;
    public $action;
    public $bloodTypes;
    public $id = "patient";
    public $name = "patient";
    public $new;
    public $patientId;

    /**
     * Create a new component instance.
     *
     * @return void
     */
    public function __construct($patient,$bloodTypes,$action,$patientId,$new=true)
    {
        $this->patient      = $patient;
        $this->action          = $action;
        $this->bloodTypes   = $bloodTypes;
        $this->new          = $new;
        $this->patientId = $patientId;

    }

    /**
     * Get the view / contents that represent the component.
     *
     * @return \Illuminate\Contracts\View\View|\Closure|string
     */
    public function render()
    {
        return view('components.patient-form',[
            "patient"=>$this->patient,
            "action"=>$this->action,
            "id"=>$this->id,
            "name"=>$this->name,
            "new"=>$this->new,
            "patientId"=>$this->patientId

        ]);
    }
}
