<?php
/**
 * Output of the single team social.
 *
 * @package cyberpress/templates
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound

$team              = cyberpress()->get_the_team();
$team_social_links = $team->get_social_links();

if ( $team_social_links && ! empty( $team_social_links ) ) : ?>
    <h3><?php echo esc_html__( 'Social', 'cyberpress' ); ?></h3>

    <div class="cyberpress-social-links">
        <ul>
            <?php foreach ( $team_social_links as $link_data ) : ?>
                <?php if ( isset( $link_data['icon'] ) ) : ?>
                    <li>
                        <a href="<?php echo esc_url( $link_data['url'] ? $link_data['url'] : '#' ); ?>">
                            <?php Brand_SVG_Please::get_e( $link_data['icon'], array( 'class' => 'cyberpress-svg-icon' ) ); ?>
                        </a>
                    </li>
                <?php endif; ?>
            <?php endforeach; ?>
        </ul>
    </div>
<?php endif; ?>
