<?php
/* @var \Tangibledesign\MyHome\Widgets\User\UserElementsWidget $mhCurrentWidget */
global $mhCurrentWidget;

$mhUser = $mhCurrentWidget->getUser();
if (!$mhUser instanceof \Tangibledesign\Framework\Models\User\User) {
    return;
}
?>
<div class="myhome-user-elements">
    <div class="myhome-user-elements__list">
        <?php
        foreach ($mhCurrentWidget->getElements() as $mhElement) :
            get_template_part('templates/widgets/user/user-elements/' . $mhElement['type'], args: [
                'element' => $mhElement,
                'user' => $mhUser,
            ]);
        endforeach;
        ?>
    </div>
</div>