<?php

use Tangibledesign\MyHome\Widgets\General\ScheduleWidget;

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

$scheduleItems = $mhCurrentWidget->getScheduleItems();

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

<div class="myhome-schedule-widget__grid">
    <?php foreach ($scheduleItems as $item) : ?>
        <div class="myhome-schedule-widget__card<?php echo !empty($item['is_featured']) && $item['is_featured'] === 'yes' ? ' myhome-schedule-widget__card--featured' : ''; ?>">
            <?php if (!empty($item['label'])) : ?>
                <div class="myhome-schedule-widget__label">
                    <?php echo esc_html($item['label']); ?>
                </div>
            <?php endif; ?>

            <?php if (!empty($item['hours'])) : ?>
                <div class="myhome-schedule-widget__hours">
                    <?php echo esc_html($item['hours']); ?>
                </div>
            <?php endif; ?>

            <?php if (!empty($item['description'])) : ?>
                <div class="myhome-schedule-widget__description">
                    <?php echo esc_html($item['description']); ?>
                </div>
            <?php endif; ?>
        </div>
    <?php endforeach; ?>
</div>