<?php

namespace App\View\Components\Admin\Form;

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

class TextArea extends Component
{
    public ?string $id;
    public ?string $name;
    public ?string $wireModel;
    public ?string $label;
    public ?string $customDivClass;
    public ?string $customInputClass;
    public mixed $value;
    public ?string $type;
    public int|null $rows;
    public bool $readOnly;
    public bool $disabled;
    public bool $required;


    /**
     * @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 $value
     * @param string|null $type
     * @param int|null $rows
     * @param bool $readOnly
     * @param bool $disabled
     * @param bool $required
     */
    public function __construct(string $id = null, string $name = null, string $wireModel = null, string $label = null, string $customDivClass = null, string $customInputClass = null, mixed $value = null, string $type = null, int $rows = null, bool $readOnly = false, bool $disabled = false, bool $required = false)
    {
        $this->id = $id ?? $name;
        $this->name = $name;
        $this->wireModel = $wireModel;
        $this->label = $label;
        $this->customDivClass = $customDivClass;
        $this->customInputClass = $customInputClass;
        $this->value = $value;
        $this->type = $type;
        $this->rows = $rows;
        $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.text-area');
    }
}
