<?php
declare(strict_types=1);

/**
 * @var \Magento\Framework\View\Element\Template $block
 * @var \Magento\Framework\Escaper $escaper
 * @var \ClawRock\Debug\Model\Collector\TranslationCollector $collector
 */
$collector = $block->getCollector();
?>
<div class="
    sf-toolbar-block
    sf-toolbar-block-<?= /* @noEscape */ $collector->getName() ?>
    sf-toolbar-status-<?= /* @noEscape */ $collector->getStatus() ?>
">
    <a target="_blank"
       href="<?= $escaper->escapeUrl($block->getProfilerUrl()); ?>">
        <div class="sf-toolbar-icon">
            <img src="
            <?= $escaper->escapeUrl($block->getViewFileUrl('ClawRock_Debug::images/collector/translation.svg')); ?>
            " alt="<?= $escaper->escapeHtmlAttr(__('Translation')) ?>"/>
            <span class="sf-toolbar-value"><?= /* @noEscape */ $collector->getTotal() ?></span>
        </div>
    </a>
    <div class="sf-toolbar-info">
        <div class="sf-toolbar-info-piece">
            <strong><?= $escaper->escapeHtml(__('Missing messages')); ?></strong>
            <span class="
                sf-toolbar-status
                sf-toolbar-status-<?= count($collector->getMissingTranslations()) ? 'red' : '' ?>
            ">
                 <?= count($collector->getMissingTranslations()); ?>
            </span>
        </div>
        <div class="sf-toolbar-info-piece">
            <strong><?= $escaper->escapeHtml(__('Defined messages')) ?></strong>
            <span class="sf-toolbar-status"><?= count($collector->getDefinedTranslations()) ?></span>
        </div>
    </div>
</div>
