@props([ 'name', 'label' => null, 'type' => 'text', 'value' => null, 'placeholder' => null, 'required' => false, 'error' => null, ]) @php $hasError = $error || ($errors->has($name) ?? false); $errorMessage = $error ?? ($errors->first($name) ?? null); $inputId = $attributes->get('id', $name); $inputValue = old($name, $value ?? ''); @endphp
@if($label) @endif merge([ 'class' => 'bg-gray-50 border-2 text-gray-900 text-sm sm:text-base rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 block w-full p-3 sm:p-4 transition ' . ($hasError ? 'border-red-500 focus:ring-red-500' : 'border-gray-300') ]) }} > @if($hasError)

{{ $errorMessage }}

@endif