@foreach ($fields as $field)
@php
$id = 'custom-field-'.$field['key'];
$name = 'custom_fields['.$field['key'].']';
$required = (bool) ($field['required'] ?? false);
$hint = filled($field['help_text'] ?? null) ? $field['help_text'] : null;
// mb-1 on top of the field's gap-2 matches the option labels' mb-3;
// with a hint, the label + hint group carries that spacing instead.
$labelClass = 'font-bold text-sm uppercase tracking-wide'.($hint ? '' : ' mb-1');
$hintId = $hint ? $id.'-hint' : null;
@endphp
@switch($field['type'])
@case('textarea')
@break
@case('file')
@break
@default
@endswitch
@endforeach