critiquing-live.php

Code Hygiene Score: 100

Keine Issues gefunden.

Code

<?php
/**
 * Critiquing Progress Partial with Live Log (HTMX Polling)
 *
 * @var int $orderId Order ID for polling
 * @var string $log Current log content
 * @var string $step Current step
 */
$log = $log ?? '';
$step = $step ?? '';
?>
<div class="critiquing-live-container"
     hx-get="/content/<?= $orderId ?>/critique-status"
     hx-trigger="load delay:1s"
     hx-swap="outerHTML">

    <div class="critiquing-live-header">
        <div class="critiquing-live-spinner">
            <span class="critiquing-live-dot"></span>
            <span class="critiquing-live-dot"></span>
            <span class="critiquing-live-dot"></span>
        </div>
        <span class="critiquing-live-status">
            <?php
            $stepLabels = [
                'init' => 'Initialisierung...',
                'critics' => 'Lade Kritiker...',
                'critic_1' => 'Kritiker 1 analysiert...',
                'critic_2' => 'Kritiker 2 analysiert...',
                'critic_3' => 'Kritiker 3 analysiert...',
                'done' => 'Fertig!',
                'error' => 'Fehler',
            ];
echo $stepLabels[$step] ?? 'Kritiker analysieren Content...';
?>
        </span>
    </div>

    <?php if ($log): ?>
    <pre class="critiquing-live-log"><?= htmlspecialchars($log) ?></pre>
    <?php else: ?>
    <pre class="critiquing-live-log">Warte auf Ausgabe...</pre>
    <?php endif; ?>

</div>
← Übersicht