<div class="row">
    <div class="col-md-8">
        <div class="row mb-3">
            <div class="col-6">
                {{ Form::label('first_name', 'Prénom') }}
                @include('components.form.input', [
                    'name' => 'first_name',
                    'value' => $customer['first_name'] ?? null,
                    'required' => true,
                ])
            </div>
            <div class="col-6">
                {{ Form::label('last_name', 'Nom') }}
                @include('components.form.input', [
                    'name' => 'last_name',
                    'value' => $customer['last_name'] ?? null,
                    'required' => true,
                ])
            </div>
        </div>
        <div class="row mb-3">
            <div class="col-12">
                {{ Form::label('company', 'Société') }}
                @include('components.form.input', [
                    'name' => 'company',
                    'value' => $customer['company'] ?? null,
                ])
            </div>
        </div>
        <div class="row mb-3">
            <div class="col-12">
                {{ Form::label('tva', 'TVA') }}
                @include('components.form.input', [
                    'name' => 'tva',
                    'value' => $customer['tva'] ?? null,
                ])
            </div>
        </div>
        <div class="row mb-3">
            <div class="col-6">
                {{ Form::label('email', 'Email') }}
                @include('components.form.input', [
                    'name' => 'email',
                    'value' => $customer['email'] ?? null,
                    'required' => true,
                ])
            </div>
            <div class="col-6">
                {{ Form::label('phone', 'Téléphone') }}
                @include('components.form.input', [
                    'name' => 'phone',
                    'value' => $customer['phone'] ?? null,
                ])
            </div>
        </div>

        <div class="row mb-3">
            <div class="col-12">
                {{ Form::label('address', 'Adresse') }}
                @include('components.form.input', [
                    'name' => 'address',
                    'value' => $customer['address'] ?? null,
                    'required' => true,
                ])
            </div>
        </div>

        <div class="row">
            <div class="col-12">
                {{ Form::label('address2', 'Adresse complémentaire') }}
                @include('components.form.input', [
                    'name' => 'address2',
                    'value' => $customer['address2'] ?? null,
                ])
            </div>
        </div>

        <div class="row mb-3">
            <div class="col-4">
                {{ Form::label('zipcode', 'Code postal') }}
                @include('components.form.input', [
                    'name' => 'zipcode',
                    'value' => $customer['zipcode'] ?? null,
                    'required' => true,
                ])
            </div>
            <div class="col-8">
                {{ Form::label('city', 'Ville') }}
                @include('components.form.input', [
                    'name' => 'city',
                    'value' => $customer['city'] ?? null,
                    'required' => true,
                ])
            </div>
        </div>

        <div class="row mb-3">
            <div class="col-6">
                @include('components.form.select', [
                    'label' => __('shop.deliveries.name'),
                    'name' => 'deliveries[]',
                    'list' => $deliveries ?? [],
                    'values' => $customer['deliveries'] ?? null,
                    'with_empty' => '',
                    'class' => 'select2',
                    'multiple' => true,
                ])
            </div>
        </div>
    </div>
    <div class="col-md-4">
        @if ($customer['addresses'])
            @include('components.address', [
                'with_country' => false,
                'prefix' => 'addresses[0]',
                'with_tab' => true,
                'item' => $customer['addresses'][0],
            ])
        @endif
    </div>
</div>

@include('components.save')

@include('load.form.save')
@include('load.form.select2')

@push('js')
    <script>
        $(function() {
            initSelect2();
            initSaveForm('#customer-form');
        });
    </script>
@endpush
