<?php

namespace App\View\Components;

use Illuminate\View\Component;

class FormInput extends Component
{
    public $name;
    public $label;
    public $type;
    public $placeholder;
    public $value;
    public $required;
    public $icon;
    public $floating;
    public $options;
    public $hint;
    public $error;

    public function __construct(
        $name,
        $label = null,
        $type = 'text',
        $placeholder = '',
        $value = null,
        $required = false,
        $icon = null,
        $floating = true,
        $options = [],
        $hint = null,
        $error = null
    ) {
        $this->name = $name;
        $this->label = $label;
        $this->type = $type;
        $this->placeholder = $placeholder;
        $this->value = $value;
        $this->required = $required;
        $this->icon = $icon;
        $this->floating = $floating;
        $this->options = $options;
        $this->hint = $hint;
        $this->error = $error;
    }

    public function render()
    {
        return view('components.form-input');
    }
}
