@foreach ($formData as $data)
    <div class="contact-form-group contact-form-group">
        <label class="form-label">{{ __($data->name) }}</label>
        @if ($data->type == 'text')
            <input type="text" class="form-control form--control mb-2" name="{{ $data->label }}"
                value="{{ old($data->label, $data->value ?? '') }}" @if ($data->is_required == 'required') required @endif>
        @elseif($data->type == 'textarea')
            <textarea class="form-control form--control" name="{{ $data->label }}" @if ($data->is_required == 'required') required @endif>{{ old($data->label, $data->value ?? '') }}</textarea>
        @elseif($data->type == 'select')
            <div class="select-item">
                <select class="select-bar" name="{{ $data->label }}" @if ($data->is_required == 'required') required @endif>
                    <option value="">@lang('Select One')</option>
                    @foreach ($data->options as $item)
                        <option value="{{ $item }}" @selected($item == old($data->label, $data->value ?? ''))>{{ __($item) }}</option>
                    @endforeach
                </select>
            </div>
        @elseif($data->type == 'checkbox')
            @foreach ($data->options as $option)
                <div class="checkgroup">
                    <input class="h-auto w-auto" name="{{ $data->label }}[]" type="checkbox"
                        value="{{ $option }}" id="{{ $data->label }}_{{ titleToKey($option) }}"
                        @checked(in_array($option, old($data->label, $data->value ?? [])))>
                    <label class="form-check-label"
                        for="{{ $data->label }}_{{ titleToKey($option) }}">{{ $option }}</label>
                </div>
            @endforeach
        @elseif($data->type == 'radio')
            @foreach ($data->options as $option)
                <div class="form-check">
                    <input class="form-check-input" name="{{ $data->label }}" type="radio"
                        value="{{ $option }}" id="{{ $data->label }}_{{ titleToKey($option) }}"
                        @checked($option == old($data->label, $data->value ?? ''))>
                    <label class="form-check-label"
                        for="{{ $data->label }}_{{ titleToKey($option) }}">{{ $option }}</label>
                </div>
            @endforeach
        @elseif($data->type == 'file')
            <input type="file" class="form-control form--control" name="{{ $data->label }}"
                @if ($data->is_required == 'required' && empty($data->value)) required @endif
                accept="@foreach (explode(',', $data->extensions) as $ext) .{{ $ext }}, @endforeach">
            <div class="d-flex">
                <pre class="text--base mt-1">@lang('Supported mimes'): {{ $data->extensions }} | </pre>
                @if (@$data->value)
                    <div class="my-1">
                        <a href="/{{ getFilePath('verify') . '/' . $data->value }}" target="_blank" ><i
                            class="fa fa-file"></i> @lang('Attachment') </a>
                    </div>
                @endif
            </div>
        @endif
    </div>
@endforeach
