<?php

namespace App\View\Components;

use Illuminate\View\Component;
use App\Models\Especiality;

class ControlHistoryForm extends Component
{
    public $model;
    public $history;
    public $optionsEspeciality;
    public $sectionTypes;
    public $physicalTest;
    public $configuration;

    /**
     * Create a new component instance.
     *
     * @return void
     */
    public function __construct($model, $history, $sectionTypes = null, $physicalTest = null, $configuration = null)
    {
        $this->history = $history;
        $this->model = $model;
        $this->optionsEspeciality = Especiality::getEspecialities();
        $this->sectionTypes = $sectionTypes;
        $this->physicalTest = $physicalTest;
        $this->configuration = $configuration;
    }

    /**
     * Get the view / contents that represent the component.
     *
     * @return \Illuminate\Contracts\View\View|\Closure|string
     */
    public function render()
    {
        return view('components.control-history-form',[
            "model" => $this->model,
            "optionsEspeciality" => $this->optionsEspeciality,
            "history" => $this->history,
            "sectionTypes" => $this->sectionTypes,
            "physicalTest" => $this->physicalTest,
            "configuration" => $this->configuration
        ]);
    }
}
