<div>
    <table class="table">
        <p>Sepete Domain Ekleyebilirsiniz</p>
        <form wire:submit.prevent="submit" >



        <tr>
            <td>Domain adı</td>
            <td>Uzantısı</td>
        </tr>
        <tr>
            <td  style="margin-right: 0;padding-right: 0">
                <input class="form-control" type="text" wire:model="name">
                @error('name') <span class="error">{{ $message }}</span> @enderror

            </td>
            <td style="margin-left: 0;padding-left: 0">
                <select class="form-control" wire:model="uzanti">
                    <option>Seçiniz</option>

                    @foreach($domainler as $domain)
                        <option value="{{$domain->baslik}}">.{{$domain->baslik}}</option>
                    @endforeach


                </select>
                @error('uzanti') <span class="error">{{ $message }}</span> @enderror


            </td>
        </tr>
        <tr>
            <td colspan="2">
                <div class="text-center">

                    <button style="padding: 5px 10px" id="yazidegistir" class="btn item-prev-btn2" type="submit" wire:loading.attr="disabled">Sorgula</button>

                </div>
            </td>
        </tr>
        </form>


    </table>




@if (\Session::has('olumlu'))


        <div class="col-sm-12 col-md-12 col-lg-12 col-xs-12">
            <div class="shadow-sm card mb-3 product">
                <div class="card-body">
                    <h6 class="card-title text-info bold product-name"><span class="text-warning">{{$this->name}}.{{$this->uzanti}}</span> Alan Adı Müsait</h6>



                    <div>

                        <span style="width: 40%;float: left">  <h4 style="font-weight: bolder" class="card-text text-success product-price">{{$this->fiyat}} ₺</h4></span>

                        <span style="float: left">
                                    <a id="" href="#" style="padding: 5px 10px" wire:click.prevent="adddomain({{$this->id}},' {{$this->name}}{{$this->uzanti}} ',{{$this->fiyat}})" class="btn" data-action="add-to-cart">Sepete Ekle</a>
                        </span>



                    </div>

                </div>
            </div>
        </div>


    @endif



@if (\Session::has('olumsuz'))


        <div class="col-sm-12 col-md-12 col-lg-12 col-xs-12">
            <div class="shadow-sm card mb-3 product">
                <div class="card-body">
                    <h6 class="card-title text-info bold product-name"><span class="text-warning">{{$this->name}}.{{$this->uzanti}}</span> Alan Adı Müsait Değil</h6>


                </div>
            </div>
        </div>


    @endif

    @once
        <script>
            window.addEventListener('domainsuccess', function(e) {
                let data = e.detail;
                let title = data.title;
                let message = data.message;
                let type = data.type;

                iziToast.show({
                    title: title,
                    message: message,
                    color: 'green',
                    position: 'bottomRight', // bottomRight, bottomLeft, topRight, topLeft, topCenter, bottomCenter, center
                    timeout: 3000,

                });
            });
        </script>
    @endonce

</div>
