<?php

use Tangibledesign\MyHome\Widgets\General\StatsWidget;

/* @var StatsWidget $mhCurrentWidget */
global $mhCurrentWidget;

$stats = $mhCurrentWidget->getStats();

if ($stats->isEmpty()) {
    return;
}
?>

<div class="myhome-stats">
    <?php foreach ($stats as $stat) : ?>
        <div class="myhome-stats__item">
            <div class="myhome-stats__value">
                <?php echo esc_html($stat['value']); ?>
            </div>
            <div class="myhome-stats__label">
                <?php echo esc_html($stat['label']); ?>
            </div>
        </div>
    <?php endforeach; ?>
</div>