<?php

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

if ( empty( $all_tabs ) || empty( $active_tab ) ) {
	return;
}

?>

<div class="row">
	<div class="col plugin-status pt-2">
		<div class="text-warning">
			<p>
				<em></em>
			</p>
		</div>
	</div>
</div>

<ul class="nav nav-tabs">
	<?php
	foreach ( $all_tabs as $label => $name ) {
		$active       = $active_tab === $label ? 'active' : '';
		$api_required = in_array( $label, $api_not_required, true ) ? '' : 'api-required';
		printf( '<li class="%s %s nav-item"><a class="nav-link" data-toggle="tab" href="#%s_%s">%s</a></li>', esc_attr( $active ), esc_attr( $api_required ), esc_attr( $id ), esc_attr( $label ), esc_attr( $name ) );
	}
	?>
</ul>
<div class="tab-content">
	<?php
	foreach ( $all_tabs as $label => $name ) {
		$active       = $active_tab === $label ? 'active in' : '';
		$api_required = in_array( $label, $api_not_required, true ) ? '' : 'api-required';
		printf( '<div id="%s_%s" class="tab-pane %s %s">', esc_attr( $id ), esc_attr( $label ), esc_attr( $api_required ), esc_attr( $active ) );
			\AcademyPro\Helper::get_template( 'wishlist-member/tabs/' . $label . '.php', array( 'courses' => $courses ) );
			echo '</div>';
	}
	?>
</div>
