<?php
declare(strict_types=1);

/**
 * @var \Magento\Framework\View\Element\Template $block
 * @var \Magento\Framework\Escaper $escaper
 * @var \ClawRock\Debug\Model\View\Summary $viewModel
 */
$viewModel = $block->getViewModel();
?>
<?php if ($profile = $viewModel->getProfile()): ?>
    <div class="status status-<?= /* @noEscape */ $profile->getStatus() ?>">
        <div class="container">
            <h2 class="break-long-words">
                <a href="<?= $escaper->escapeUrl($profile->getUrl()) ?>"><?= /* @noEscape */ $profile->getUrl() ?></a>
            </h2>
            <?php if ($profile->hasRedirect()): ?>
                <?= /* @noEscape */  $viewModel->renderRedirect($profile->getRedirect()); ?>
            <?php endif; ?>
            <dl class="metadata">
                <dt><?= $escaper->escapeHtml(__('Method')) ?></dt>
                <dd><?= /* @noEscape */ $profile->getMethod() ?></dd>
                <?php if ($profile->getRoute()): ?>
                    <dt><?= $escaper->escapeHtml(__('Route')) ?></dt>
                    <dd>@<?= /* @noEscape */  $profile->getRoute(); ?></dd>
                <?php endif; ?>
                <dt><?= $escaper->escapeHtml(__('HTTP Status')) ?></dt>
                <dd><?= /* @noEscape */ $profile->getStatusCode() ?></dd>
                <dt><?= $escaper->escapeHtml(__('IP')) ?></dt>
                <dd><?= /* @noEscape */ $profile->getIp() ?></dd>
                <dt><?= $escaper->escapeHtml(__('Profiled on')) ?></dt>
                <dd><?= /* @noEscape */ $profile->getTime() ?></dd>
                <dt><?= $escaper->escapeHtml(__('Token')) ?></dt>
                <dd><?= /* @noEscape */ $profile->getToken(); ?></dd>
            </dl>
        </div>
    </div>
<?php endif; ?>
