<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
$paylasimlar_url = admin_url( 'admin.php?page=tilfy-paylasimlar' );
?>
<div class="wrap tilfy-wrap tilfy-iy-wrap" id="tilfy-islem-yoneticisi-sayfa">
	<header class="tilfy-header tilfy-header--row tilfy-iy-header">
		<div>
			<h1><?php echo esc_html( tilfy__( 'İşlem yöneticisi' ) ); ?></h1>
			<p class="tilfy-sub"><?php echo esc_html( tilfy__( 'Kuyruk, paylaşımlar ve arka plan işlemleri.' ) ); ?></p>
		</div>
		<div class="tilfy-paylasim-ust">
			<a class="tilfy-btn tilfy-btn--ikincil tilfy-btn--kucuk" href="<?php echo esc_url( $paylasimlar_url ); ?>"><?php echo esc_html( tilfy__( 'Paylaşımlar' ) ); ?></a>
		</div>
	</header>

	<div class="tilfy-iy-panel" id="tilfy-islem-yoneticisi" aria-live="polite">
		<div class="tilfy-iy-ust">
			<span class="tilfy-iy-durum is-idle" id="tilfy-islem-durum"><?php echo esc_html( tilfy__( 'Boşta' ) ); ?></span>
			<div class="tilfy-iy-saylar" id="tilfy-islem-saylar"></div>
		</div>
		<section class="tilfy-iy-kart tilfy-iy-kart--tablo tilfy-iy-kart--compact">
			<div class="tilfy-iy-tablo-ust">
				<h2><?php echo esc_html( tilfy__( 'İşlem kuyruğu' ) ); ?> <span class="tilfy-iy-kuyruk-say" id="tilfy-islem-kuyruk-say"></span></h2>
				<div class="tilfy-iy-tablo-araclar">
					<label class="tilfy-iy-secenek"><input type="checkbox" id="tilfy-islem-kuyruk-iptal-paylasim" /> <?php echo esc_html( tilfy__( 'Paylaşım iptal' ) ); ?></label>
					<button type="button" class="tilfy-btn tilfy-btn--ikincil tilfy-btn--kucuk" id="tilfy-islem-kuyruk-sil"><?php echo esc_html( tilfy__( 'Sil' ) ); ?></button>
					<button type="button" class="tilfy-btn tilfy-btn--ikincil tilfy-btn--kucuk" id="tilfy-islem-kuyruk-zorla"><?php echo esc_html( tilfy__( 'Zorla durdur' ) ); ?></button>
				</div>
			</div>
			<div class="tilfy-iy-aktif-is" id="tilfy-islem-aktif-is" hidden>
				<div class="tilfy-iy-aktif-is__ust">
					<strong id="tilfy-islem-aktif-baslik"><?php echo esc_html( tilfy__( 'Aktif iş' ) ); ?></strong>
					<span id="tilfy-islem-aktif-yuzde"><?php echo esc_html( tilfy__( '0%' ) ); ?></span>
				</div>
				<div class="tilfy-islem-bar tilfy-islem-bar--aktif"><span id="tilfy-islem-aktif-bar" style="width:0%"></span></div>
			</div>
			<div class="tilfy-iy-tablo-scroll tilfy-iy-tablo-scroll--orta">
				<table class="tilfy-iy-tablo">
					<thead>
						<tr>
							<th class="tilfy-iy-col-sec"><input type="checkbox" id="tilfy-islem-kuyruk-tumu" aria-label="<?php echo esc_attr( tilfy__( 'Tümünü seç' ) ); ?>" /></th>
							<th class="tilfy-iy-col-gorsel"><?php echo esc_html( tilfy__( 'Görsel' ) ); ?></th>
							<th><?php echo esc_html( tilfy__( 'İşlem' ) ); ?></th>
							<th><?php echo esc_html( tilfy__( 'İçerik ID' ) ); ?></th>
							<th><?php echo esc_html( tilfy__( 'Kaynak → Hedef' ) ); ?></th>
							<th><?php echo esc_html( tilfy__( 'Durum' ) ); ?></th>
							<th><?php echo esc_html( tilfy__( 'Bağlantılar' ) ); ?></th>
						</tr>
					</thead>
					<tbody id="tilfy-islem-kuyruk"></tbody>
				</table>
			</div>
		</section>

		<section class="tilfy-iy-kart tilfy-iy-kart--debug tilfy-iy-kart--compact" id="tilfy-islem-debug-wrap">
			<h2 class="tilfy-iy-kart-baslik"><?php echo esc_html( tilfy__( 'Tanılama' ) ); ?></h2>
			<div class="tilfy-iy-debug" id="tilfy-islem-debug"><?php echo esc_html( tilfy__( 'Yükleniyor…' ) ); ?></div>
		</section>

		<section class="tilfy-iy-kart tilfy-iy-kart--compact" id="tilfy-islem-api-wrap">
			<h2 class="tilfy-iy-kart-baslik"><?php echo esc_html( tilfy__( 'API yanıtları' ) ); ?></h2>
			<div class="tilfy-iy-api" id="tilfy-islem-api-yanit"><?php echo esc_html( tilfy__( 'Yükleniyor…' ) ); ?></div>
		</section>

		<footer class="tilfy-iy-alt">
			<button type="button" class="tilfy-btn tilfy-btn--ikincil tilfy-btn--kucuk" id="tilfy-islem-duraklat"><?php echo esc_html( tilfy__( 'Duraklat' ) ); ?></button>
			<button type="button" class="tilfy-btn tilfy-btn--ikincil tilfy-btn--kucuk" id="tilfy-islem-devam" hidden><?php echo esc_html( tilfy__( 'Devam' ) ); ?></button>
			<button type="button" class="tilfy-btn tilfy-btn--ikincil tilfy-btn--kucuk" id="tilfy-islem-iptal"><?php echo esc_html( tilfy__( 'Bekleyenleri iptal' ) ); ?></button>
			<button type="button" class="tilfy-btn tilfy-btn--ikincil tilfy-btn--kucuk" id="tilfy-islem-takili-iptal"><?php echo esc_html( tilfy__( 'Takılı işleri iptal' ) ); ?></button>
		</footer>
	</div>
</div>

<div class="tilfy-iy-modal" id="tilfy-islem-detay-modal" hidden>
	<div class="tilfy-iy-modal__backdrop" data-islem-modal-kapat></div>
	<div class="tilfy-iy-modal__panel" role="dialog" aria-modal="true" aria-labelledby="tilfy-islem-detay-baslik">
		<header class="tilfy-iy-modal__ust">
			<h2 id="tilfy-islem-detay-baslik"><?php echo esc_html( tilfy__( 'İşlem detayı' ) ); ?></h2>
			<button type="button" class="tilfy-iy-modal__kapat" id="tilfy-islem-detay-kapat" aria-label="<?php echo esc_attr( tilfy__( 'Kapat' ) ); ?>">&times;</button>
		</header>
		<div class="tilfy-iy-modal__govde" id="tilfy-islem-detay-icerik"></div>
	</div>
</div>
