Current File : /home/n742ef5/royalanteam.com/wp-content/themes/myhome/templates/widgets/model/listing_features.php
<?php

use Tangibledesign\MyHome\Widgets\Listing\ListingFeaturesWidget;

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

$mhAttributes = $mhCurrentWidget->getAttributes();
if ($mhAttributes->isEmpty()) {
    return;
}
?>
<div class="myhome-listing-section">
    <?php if (!empty($mhCurrentWidget->getLabel())) : ?>
        <h3 class="myhome-listing-section__label">
            <?php echo esc_html($mhCurrentWidget->getLabel()); ?>
        </h3>
    <?php endif; ?>

    <div class="myhome-listing-features">
        <?php foreach ($mhAttributes as $mhAttribute) : ?>
            <?php foreach ($mhAttribute['value'] as $mhValue) : ?>
                <div class="myhome-listing-feature">
                    <div class="myhome-listing-feature__icon-wrapper">
                        <div class="myhome-listing-feature__icon">
                            <?php if (!empty($mhAttribute['icon']['value'])) : ?>
                                <?php if ($mhAttribute['icon']['library'] === 'svg') : ?>
                                    <?php echo tdf_load_icon($mhAttribute['icon']['value']['url']); ?>
                                <?php else : ?>
                                    <i class="<?php echo esc_attr($mhAttribute['icon']['value']); ?>"></i>
                                <?php endif; ?>
                            <?php else : ?>
                                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
                                    <!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
                                    <path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/>
                                </svg>
                            <?php endif; ?>
                        </div>
                    </div>

                    <div class="myhome-listing-feature__content">
                        <?php if (!empty($mhAttribute['text_before'])) : ?>
                            <span class="myhome-listing-feature__text-before">
                                <?php echo esc_html($mhAttribute['text_before']); ?>
                            </span>
                        <?php endif; ?>

                        <span class="myhome-listing-feature__value">
                            <?php echo esc_html($mhValue); ?>
                        </span>

                        <?php if (!empty($mhAttribute['text_after'])) : ?>
                            <span class="myhome-listing-feature__text-after">
                                <?php echo esc_html($mhAttribute['text_after']); ?>
                            </span>
                        <?php endif; ?>
                    </div>
                </div>
            <?php endforeach; ?>
        <?php endforeach; ?>
    </div>
</div>