<?php
/**
 * Admin tab navigation.
 *
 * @package MacaHold
 *
 * @var string               $current_tab
 * @var array<string, string> $tabs
 */

defined( 'ABSPATH' ) || exit;

if ( count( $tabs ) < 2 ) {
	return;
}
?>
<nav class="nav-tab-wrapper wp-clearfix" aria-label="<?php echo esc_attr__( 'maca Hold sections', 'maca-hold' ); ?>">
	<?php foreach ( $tabs as $maca_hold_tab_slug => $maca_hold_tab_label ) : ?>
		<?php
		$maca_hold_tab_url = 'general' === $maca_hold_tab_slug
			? Maca_Hold_Admin_Page::get_page_url()
			: Maca_Hold_Admin_Page::get_page_url( array( 'tab' => $maca_hold_tab_slug ) );
		?>
		<a
			href="<?php echo esc_url( $maca_hold_tab_url ); ?>"
			class="nav-tab<?php echo $current_tab === $maca_hold_tab_slug ? ' nav-tab-active' : ''; ?>"
		>
			<?php echo esc_html( $maca_hold_tab_label ); ?>
		</a>
	<?php endforeach; ?>
</nav>
