<?php defined('ABSPATH') or die;

use WPSocialReviews\Framework\Support\Arr;

// end wpsr-twitter-all-tweets div
echo '</div>';

if( $layout_type === 'carousel' && defined('WPSOCIALREVIEWS_PRO')) {
    echo '</div>'; // swiper container end
    echo '<div class="wpsr-swiper-carousel-wrapper">';
        if( $feed_settings['carousel_settings']['navigation'] === 'arrow' || $feed_settings['carousel_settings']['navigation'] === 'both') {
            echo '<div class="wpsr-swiper-prev-next wpsr-swiper-next swiper-button-next"></div>
              <div class="wpsr-swiper-prev-next wpsr-swiper-prev swiper-button-prev"></div>';
        }
        if( $feed_settings['carousel_settings']['navigation'] === 'dot' || $feed_settings['carousel_settings']['navigation'] === 'both') {
            echo '<div class="wpsr-swiper-pagination swiper-pagination"></div>';
        }
    echo '</div>';
}

$wpsr_mt_30 = $column_gaps === 'no_gap' ? 'wpsr-mt-20' : '';
echo '<div class="wpsr-twitter-footer wpsr-row ' . esc_attr($wpsr_mt_30) . '">';

//render pagination
if ($total > $paginate && $layout_type !== 'carousel' && $pagination_type !== 'none') {
    $wpsr_load_more_button_text = $feed_settings['pagination_settings']['load_more_button_text'];
    echo '<button 
    aria-label="'.esc_attr($wpsr_load_more_button_text).'"
    class="wpsr-twitter-loadmore wpsr_more wpsr-load-more-default" 
    id="wpsr-twitter-load-more-btn' . esc_attr($templateId) . '" 
    data-template_id="' . intval($templateId) . '" 
    data-template_type="' . esc_attr($layout_type) . '" 
    data-total="' . intval($total) . '" 
    data-page="1"
    data-platform="twitter"
    data-paginate="' . esc_attr($paginate) . '" >' .esc_html($wpsr_load_more_button_text).
         '<div class="wpsr-load-icon-wrapper"><span></span></div></button>';
}
$wpsr_feed_type = isset($feed_settings['additional_settings']['feed_type']) ? $feed_settings['additional_settings']['feed_type'] : '';
$show_follow_btn = !empty($header)
    && !empty(Arr::get($feed_settings, 'follow_button_settings.display_follow_button'))
    && Arr::get($feed_settings, 'follow_button_settings.display_follow_button') === 'true'
    && Arr::get($feed_settings, 'follow_button_settings.follow_button_position') !== 'header'
    && $wpsr_feed_type !== 'hashtag';
if ($show_follow_btn) {
    /**
     * tweeter_user_profile_follow_btn hook.
     *
     * @hooked wpsr_render_tweeter_user_profile_follow_btn_html 10
     * */
    do_action('wpsocialreviews/tweeter_user_profile_follow_btn', $header, $feed_settings['follow_button_settings']);
}
// end wpsr-twitter-footer div
echo '</div>';

// end wpsr-twitter-wrapper-inner div
echo '</div>';

// end wpsr-twitter-tweets-wrapper div
echo '</div>';

