<div>
    @include('parts.overlay', ['target' => 'store, update'])

    <form wire:submit.prevent="{{ $form['action'] }}" autocomplete="off">
        <div class="row match-height mt-2">
            <div class="col-12">
                <div class="card">
                    <div class="card-header">
                        <h4 class="card-title">Datos del cliente</h4>
                    </div>
                    <div class="card-content">
                        <div class="card-body">
                            <div class="row">
                                <div class="{{ $data['type_form'] == 'quote' ? 'col-6' : 'col-4' }}">
                                    <div class="form-group">
                                        <label for="document">Cédula</label>
                                        <input type="text" class="form-control" wire:model="data.document" placeholder="Cédula" id="document">
                                        @error('data.document') <span class="text-danger">{{ $message }}</span>@enderror
                                    </div>
                                </div>
                                <div class="{{ $data['type_form'] == 'quote' ? 'col-6' : 'col-4' }}">
                                    <div class="form-group">
                                        <label for="name">Nombre y apellido</label>
                                        <input type="text" class="form-control" wire:model="data.name" placeholder="Nombre y apellido" id="name">
                                        @error('data.name') <span class="text-danger">{{ $message }}</span>@enderror
                                    </div>
                                </div>
                                <div class="{{ $data['type_form'] == 'quote' ? 'col-6' : 'col-4' }}">
                                    <div class="form-group">
                                        <label for="phone">Teléfono</label>
                                        <input type="text" class="form-control" wire:model="data.phone" placeholder="Teléfono" id="phone">
                                        @error('data.phone') <span class="text-danger">{{ $message }}</span> @enderror
                                    </div>
                                </div>
                                <div class="{{ $data['type_form'] == 'quote' ? 'col-6' : 'col-4' }}">
                                    <div class="form-group">
                                        <label for="email">Email</label>
                                        <input type="text" class="form-control" wire:model="data.email" placeholder="Email" id="email">
                                        @error('data.email') <span class="text-danger">{{ $message }}</span> @enderror
                                    </div>
                                </div>

                                <div class="col-12 d-flex justify-content-end">
                                    <button id="btn-submit" type="submit" class="btn btn-primary mr-1 mb-1" wire:loading.attr="disabled"
                                        wire:target="{{ $form['action'] }}">
                                        <i class="far fa-save"></i>
                                        {{ $form['label'] }}
                                    </button>
                                    @if ($data['type_form'] != 'quote')
                                        <a href="{{ route('vehicle-quote.customers.index') }}" class="btn btn-light-secondary mr-1 mb-1">
                                            <i class="fas fa-ban"></i>
                                            Cancelar
                                        </a>
                                    @endif
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
