<?php

namespace App\View\Components\Admin\Form;

use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;

class Select extends Component
{
    public ?string $id;
    public ?string $name;
    public ?string $wireModel;
    public ?string $label;
    public ?string $customDivClass;
    public ?string $customInputClass;
    public mixed $options;
    public mixed $selected;
    public ?string $type;
    public bool $readOnly;
    public bool $disabled;
    public bool $required;
    public bool $wireIgnore;


    /**
     * @param string|null $id
     * @param string|null $name
     * @param string|null $wireModel
     * @param string|null $label
     * @param string|null $customDivClass
     * @param string|null $customInputClass
     * @param mixed|null $options
     * @param mixed|null $selected
     * @param string|null $type
     * @param bool $readOnly
     * @param bool $disabled
     * @param bool $required
     * @param bool $wireIgnore
     */
    public function __construct(string $id = null, string $name = null, string $wireModel = null, string $label = null, string $customDivClass = null, string $customInputClass = null,  mixed $options = null, mixed $selected = null, string $type = null, bool $readOnly = false, bool $disabled = false, bool $required = false, bool $wireIgnore = false)
    {
        $this->id = $id ?? $name;
        $this->name = $name;
        $this->wireModel = $wireModel;
        $this->wireIgnore = $wireIgnore;
        $this->label = $label;
        $this->customDivClass = $customDivClass;
        $this->customInputClass = $customInputClass;
        $this->options = $options;
        $this->selected = $selected;
        $this->type = $type;
        $this->disabled = $disabled;
        $this->readOnly = $readOnly;
        $this->required = $required;
    }

    /**
     * Get the view / contents that represent the component.
     */
    public function render(): View|Closure|string
    {
        return view('components.admin.form.select');
    }
}
