@props([ 'label', 'name', 'type' => 'text', 'value' => '', 'required' => false, 'readonly' => false, 'placeholder' => '', 'options' => [], 'rows' => 3, 'fullWidth' => false, 'mode' => 'edit' ]) @php $isReadOnly = $readonly || ($mode === 'view') || (auth()->user()->role === 'expectant_mother'); $fieldId = 'field_' . str_replace(['[', ']', '.'], ['_', '_', '_'], $name); @endphp
@if($isReadOnly)
@if($type === 'radio' || $type === 'checkbox') {{ $value ?? '—' }} @elseif($type === 'textarea') {{ $value ?? '—' }} @else {{ $value ?? '—' }} @endif
@else @if($type === 'select') @elseif($type === 'textarea') @elseif($type === 'radio')
@foreach($options as $optionValue => $optionLabel) @endforeach
@elseif($type === 'checkbox') @else @endif @endif @error($name)

{{ $message }}

@enderror