<?php

namespace App\View\Components;

use Illuminate\View\Component;

class RepresentativeForm extends Component
{
    public $representative;
    public $action;
    public $bloodTypes;
    public $id = "representative";
    public $name = "representative";
    public $new;
    public $patientId;
    /**
     * Create a new component instance.
     *
     * @return void
     */
    public function __construct($representative,$bloodTypes,$action,$patientId,$new=true)
    {
        $this->representative      = $representative;
        $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.representative-form',[
            "representative"=>$this->representative,
            "action"=>$this->action,
            "id"=>$this->id,
            "name"=>$this->name,
            "new"=>$this->new,
            "patientId"=>$this->patientId
        ]);
    }
}
