<?php
/* @var array $args */
$mhUser = $args['user'] ?? null;
$element = $args['element'] ?? null;

if (
    !$mhUser instanceof \Tangibledesign\Framework\Models\User\User
    || !$element
    || empty($mhUser->getJobTitle())
) {
    return;
}
?>
<div class="myhome-user-elements__job-title">
    <?php if (!empty($element['text_before'])) : ?>
        <span class="myhome-user-elements__job-title-text-before">
            <?php echo esc_html($element['text_before']); ?>
        </span>
    <?php endif; ?>

    <span class="myhome-user-elements__job-title-value">
        <?php echo esc_html($mhUser->getJobTitle()); ?>
    </span>

    <?php if (!empty($element['text_after'])) : ?>
        <span class="myhome-user-elements__job-title-text-after">
            <?php echo esc_html($element['text_after']); ?>
        </span>
    <?php endif; ?>
</div>