<?php

use Tangibledesign\MyHome\Widgets\General\HeadingWidget;

/* @var HeadingWidget $mhCurrentWidget */
global $mhCurrentWidget;
?>
<div
        <?php if($mhCurrentWidget->showButton()) : ?>
            class="myhome-heading-wrapper myhome-heading-wrapper--with-button"
        <?php else : ?>
            class="myhome-heading-wrapper"
        <?php endif; ?>
>
    <div class="myhome-heading myhome-heading--<?php echo esc_attr($mhCurrentWidget->getAlignment()); ?> myhome-heading--tablet-<?php echo esc_attr($mhCurrentWidget->getTabletAlignment()); ?> myhome-heading--mobile-<?php echo esc_attr($mhCurrentWidget->getMobileAlignment()); ?>">
        <?php if ($mhCurrentWidget->hasSmallHeading())  : ?>
            <<?php echo esc_html($mhCurrentWidget->getSmallHeadingTag()) ?> class="myhome-heading__small-text">
                <?php echo esc_html($mhCurrentWidget->getSmallHeading()); ?>
            </<?php echo esc_html($mhCurrentWidget->getSmallHeadingTag()) ?>>
        <?php endif; ?>

        <<?php echo esc_html($mhCurrentWidget->getHeadingTag()) ?> class="myhome-heading__text">
            <?php echo wp_kses_post(nl2br($mhCurrentWidget->getHeading())); ?>
        </<?php echo esc_html($mhCurrentWidget->getHeadingTag()) ?>>
    </div>

    <?php if ($mhCurrentWidget->showButton()) : ?>
        <a
                class="myhome-button myhome-button--primary-1"
                href="<?php echo esc_url($mhCurrentWidget->getButtonUrl()); ?>"
        >
            <?php echo esc_html($mhCurrentWidget->getButtonText()); ?>
        </a>
    <?php endif; ?>
</div>