<?php

use ipl\Stdlib\Str;
use ipl\Web\Widget\Icon;

?>
<div class="controls">
    <?= $tabs ?>
</div>
<div class="content">
    <?php foreach ($navigation as $item): /** @var \Icinga\Web\Navigation\NavigationItem $item */?>
    <a class="dashboard-link" href="<?= $this->url($item->getUrl(), $item->getUrlParameters()) ?>"<?= $this->propertiesToString($item->getAttributes()) ?>>
        <div class="link-icon">
        <?php
            if (Str::startsWith($item->getIcon(), 'fa-') || substr($item->getUrl()->getPath(), 0, 9) === 'icingadb/') {
                echo new Icon($item->getIcon() ?: 'share', [ 'aria-hidden' => 1]);
            } else {
                echo $this->icon($item->getIcon() ?: 'forward', null, array('aria-hidden' => true));
            }
        ?>
        </div>
        <div class="link-meta">
            <div class="link-label"><?= $this->escape($item->getLabel()) ?></div>
            <div class="link-description"><?= $this->escape($item->getDescription() ?: sprintf('Open %s', strtolower($item->getLabel()))) ?></div>
        </div>
    </a>
    <?php endforeach ?>
</div>
