@foreach ($addresses ?? [] as $address)
    <div class="row mt-3">
        <div class="col-1">
            <x-form.radios.icheck name="@if ($prefix ?? false) {{ $prefix }} . '[]' @endif address_id"
                val="{{ $address['id'] }}" id="address_{{ $address['id'] }}" />
        </div>
        <div class="col-11">
            {{ $address['address'] }}<br />
            @if ($address['address2'])
                {{ $address['address2'] }}<br />
            @endif
            {{ $address['zipcode'] }} {{ $address['city'] }}
        </div>
    </div>
@endforeach

<div id="add_address_container_{{ $prefix }}" class="green-dark d-none mb-3 mt-3">
    <x-card classBody="bg-green-dark yellow" title="Nouvelle adresse">
        @include('Shop.Customers.partials.address', [
            'prefix' => $prefix,
            'with_country' => false,
            'with_tab' => true,
            'label' => 'Adresse',
            'customer' => [],
        ])
    </x-card>
</div>

<div class="row">
    <div class="col-12 text-right">
        <x-form.button id="add_address_{{ $prefix }}" icon="fa-plus" txt="Ajouter une adresse"
            class="btn-warning btn-sm" />
    </div>
</div>

@push('js')
    <script>
        $('#add_address_{{ $prefix }}').click(function() {
            $('#add_address_container_{{ $prefix }}').toggleClass('d-none');
        })
    </script>
@endpush
