<?php
declare(strict_types=1);

/**
 * @var \Magento\Framework\View\Element\Template $block
 * @var \Magento\Framework\Escaper $escaper
 * @var \ClawRock\Debug\Model\View\Menu $viewModel
 */
$viewModel = $block->getViewModel();
?>
<?php if ($viewModel->isActive($block->getCollectorName())): ?>
    <?php /** @var \ClawRock\Debug\Model\Collector\TranslationCollector $collector */ ?>
    <?php $collector = $viewModel->getCollector($block->getCollectorName()); ?>
    <li class="request<?= $viewModel->isCurrentPanel($block->getCollectorName()) ? ' selected' : '' ?>">
        <a href="<?= $escaper->escapeUrl($viewModel->getProfilerUrl($block->getCollectorName())); ?>">
            <span class="label label-status-<?= /* @noEscape */ $collector->getStatus() ?>">
                <span class="icon">
                    <img src="
                    <?= $escaper->escapeUrl(
                        $block->getViewFileUrl('ClawRock_Debug::images/collector/translation.svg')
                    ); ?>
                    " alt="<?= $escaper->escapeHtmlAttr(__('Translation')); ?>"/>
                </span>
                <strong><?= $escaper->escapeHtml(__('Translation')); ?></strong>
                <?php if (count($collector->getMissingTranslations())): ?>
                    <span class="count">
                        <span><?= count($collector->getMissingTranslations()) ?></span>
                    </span>
                <?php endif; ?>
            </span>
        </a>
    </li>
<?php endif; ?>
