<?php
// Featured Author Section
if (1 != united_blog_get_option('enable_author_section')) {
    return null;
}
$author_section_title = united_blog_get_option('author_section_title');
$author_section_description = united_blog_get_option('author_section_description');
$author_section_image = united_blog_get_option('author_section_image');
$author_facebook_url = united_blog_get_option('author_facebook_url');
$author_twiter_url = united_blog_get_option('author_twiter_url');
$author_instagram_url = united_blog_get_option('author_instagram_url');
$author_linkedin_url = united_blog_get_option('author_linkedin_url');
?>
<section class="united-block united-link-in-bio">
    <div class="united-profile-background"></div>
    <div class="united-profile-details">

        <?php if (!empty($author_section_image)): ?>
            <div class="united-profile-picture">
                <img src="<?php echo esc_url($author_section_image); ?>" alt="Author's Profile Picture"
                     loading="lazy">
            </div>
        <?php endif; ?>
        <header class="united-profile-header">
            <?php if (!empty($author_section_title)): ?>
                <h2 class="united-profile-title">
                    <?php echo esc_html($author_section_title); ?>
                </h2>
            <?php endif; ?>
            <?php if (!empty($author_section_description)): ?>
                <div class="united-profile-description">
                    <?php echo esc_html($author_section_description); ?>
                </div>
            <?php endif; ?>
        </header>
        <div class="united-profile-links">
            <?php if (!empty($author_facebook_url)) { ?>
                <a href="<?php echo esc_url($author_facebook_url); ?>" class="united-button united-button-primary" target="_blank">
                    <?php echo united_blog_theme_svg_social('facebook'); ?>
                </a>
            <?php } ?>
            <?php if (!empty($author_twiter_url)) { ?>
                <a href="<?php echo esc_url($author_twiter_url); ?>" class="united-button united-button-primary" target="_blank">
                    <?php united_blog_theme_svg_social('twitter'); ?>
                </a>
            <?php } ?>
            <?php if (!empty($author_instagram_url)) { ?>
                <a href="<?php echo esc_url($author_instagram_url); ?>" class="united-button united-button-primary" target="_blank">
                    <?php united_blog_theme_svg_social('instagram'); ?>
                </a>
            <?php } ?>
            <?php if (!empty($author_linkedin_url)) { ?>
                <a href="<?php echo esc_url($author_linkedin_url); ?>" class="united-button united-button-primary" target="_blank">
                    <?php united_blog_theme_svg_social('linkedin'); ?>
                </a>
            <?php } ?>
        </div>

    </div>
</section>
