@props([
    'label'    => '',
    'name'     => '',
    'icon'     => null,
    'required' => false,
    'helpText' => null,
    'rows'     => 4,
    'value'    => null,
])

<div class="sshia-field-group">
    @if($label)
        <label for="{{ $name }}" class="sshia-label">
            @if($icon)
                <i class="fas fa-{{ $icon }} sshia-label-icon"></i>
            @endif
            {{ $label }}
            @if($required)
                <span class="sshia-required" aria-hidden="true">*</span>
            @endif
        </label>
    @endif

    <div class="sshia-input-shell @error($name) sshia-input-shell--error @enderror">
        <textarea
            id="{{ $name }}"
            name="{{ $name }}"
            rows="{{ $rows }}"
            @if($required) required @endif
            {{ $attributes->merge(['class' => 'sshia-textarea']) }}
        >{{ old($name, $value) }}</textarea>
    </div>

    @if($helpText)
        <p class="sshia-help-text">{{ $helpText }}</p>
    @endif

    @error($name)
        <p class="sshia-error-text" role="alert">
            <i class="fas fa-circle-exclamation mr-1"></i>{{ $message }}
        </p>
    @enderror
</div>
