{{-- Ortak çeviri editörü. Beklenen: $marketplaces, $fetchUrl, $saveUrl --}}
@if($marketplaces->isEmpty())
    <div class="pqv-empty"><i class="fas fa-language"></i><p>Önce Ayarlar sekmesinden pazaryeri ekleyin.</p></div>
@else
    <div data-pqv-trans data-pqv-trans-url="{{ $fetchUrl }}">
        <div class="pqv-section">
            <div class="pqv-form">
                <div class="pqv-fld">
                    <label>Pazaryeri</label>
                    <select class="pqv-inp" data-pqv-trans-mp>
                        <option value="">Pazaryeri seçin…</option>
                        @foreach($marketplaces as $mp)
                            <option value="{{ $mp->id }}" data-langs='@json($mp->languages->map(fn($l) => ['id' => $l->id, 'name' => $l->name, 'code' => $l->code])->values())'>{{ $mp->name }}</option>
                        @endforeach
                    </select>
                </div>
                <div class="pqv-fld">
                    <label>Dil</label>
                    <select class="pqv-inp" data-pqv-trans-lang><option value="">Önce pazaryeri seçin…</option></select>
                </div>
            </div>
        </div>

        <form class="pqv-section" data-pqv-trans-ws style="display:none" data-pqv-save data-method="POST" action="{{ $saveUrl }}">
            <input type="hidden" name="marketplace_id">
            <input type="hidden" name="language_id">
            <div class="pqv-form">
                <div class="pqv-fld full"><label>Tur Adı</label><input type="text" name="name" class="pqv-inp"></div>
                <div class="pqv-fld full"><label>Kısa Açıklama</label><textarea name="short_description" class="pqv-inp"></textarea></div>
                <div class="pqv-fld full"><label>Açıklama (HTML)</label><textarea name="description" class="pqv-inp"></textarea></div>
                <div class="pqv-fld full"><label>Öne Çıkanlar (HTML)</label><textarea name="highlights" class="pqv-inp"></textarea></div>
                <div class="pqv-fld full"><label>Dahil Olanlar (HTML)</label><textarea name="inclusions" class="pqv-inp"></textarea></div>
                <div class="pqv-fld full"><label>Dahil Olmayanlar (HTML)</label><textarea name="exclusions" class="pqv-inp"></textarea></div>
                <div class="pqv-fld full"><label>İptal Politikası (HTML)</label><textarea name="cancellation_policy" class="pqv-inp"></textarea></div>
                <div class="pqv-fld full"><label>Meta Başlık</label><input type="text" name="meta_title" class="pqv-inp"></div>
                <div class="pqv-fld full"><label>Meta Açıklama</label><textarea name="meta_description" class="pqv-inp"></textarea></div>
            </div>
            <div class="mt-2 text-end"><button type="submit" class="pqv-btn pqv-btn-primary"><i class="fas fa-save"></i> Çeviriyi Kaydet</button></div>
        </form>
    </div>
@endif
