<div class="mb-3">
    @if(isset($label) && $label)
    <label for="{{ $for ?? $name }}" class="form-label text-bold">
        {{ __($label) }}:
        @if(isset($required) && $required)
        <span class="span-admin-create">*</span>
        @endif
    </label>
    @endif
    <div class="{{ (isset($inputGroup) && $inputGroup) ? 'input-group' : '' }}">
        @php
        $valor = old($name, $old ?? '');
        if (is_array($valor)) {
            $valor = implode(', ', $valor);
        }
    @endphp

        <input type="{{ $type ?? 'text' }}"
               class="form-control @if(isset($name)) @error($name) is-invalid @enderror @endif"
               name="{{ $name ?? '' }}"
               id="{{ $id ?? $name }}"
               value="{{ $valor }}"
               @if(isset($oninput) && $oninput) oninput="{{ $oninput }}" @endif
               @if(isset($onchange) && $onchange) onchange="{{ $onchange }}" @endif
               autocomplete="off"
           @if(!empty($listName) && $listName != null) list="{{ $listName }}" @endif
           @if(!empty($placeholder) && $placeholder != null) placeholder="{{ $placeholder }}" @endif
           @if(!empty($autocomplete) && $autocomplete != null) autocomplete="{{ $autocomplete }}" @endif
        {{ ($multiple ?? false) ? 'multiple' : '' }}
        {{ ($required ?? false) ? 'required' : '' }}
        {{ ($readonly ?? false) ? 'readonly' : '' }}
        @if(!empty($accept) && $accept != null) accept="{{ $accept }}" @endif>

        @if(!empty($arrayList) && $arrayList != null)
        <datalist id="{{ $listName }}">
            @foreach($arrayList as $item)
                <option value="{!! __($item) !!}"></option>                            
            @endforeach
        </datalist>
    @endif

    @if(!empty($toggleButton) && $toggleButton != null)
        <button type="button" class="btn btn-outline-secondary" id="{{ $toggleButtonId }}">
            {!! $toggleButtonFontawesome !!}
        </button>
    @endif

    @if(isset($small) && $small)
        <small class="text-secondary text-bold">{!! __($small) !!}</small>
    @endif

    @error(isset($name) && $name)
        <small class="text-danger text-bold">{{ __($message) }}</small>
    @enderror
</div>
</div>
