<?php
/**
 * SalonPro X - Breadcrumb Partial
 * @var array $breadcrumb Array of [label => url] pairs
 */
$items = $breadcrumb ?? [];
?>
<nav aria-label="breadcrumb" class="page-breadcrumb">
    <ol class="breadcrumb">
        <li class="breadcrumb-item">
            <a href="<?= url('dashboard') ?>">
                <i class="fas fa-home"></i>
            </a>
        </li>
        <?php $count = count($items); $i = 0; ?>
        <?php foreach ($items as $label => $url): $i++; ?>
            <?php if ($i === $count): ?>
                <li class="breadcrumb-item active" aria-current="page"><?= e($label) ?></li>
            <?php else: ?>
                <li class="breadcrumb-item">
                    <a href="<?= e($url) ?>"><?= e($label) ?></a>
                </li>
            <?php endif; ?>
        <?php endforeach; ?>
    </ol>
</nav>
