<?php
/**
 * Account Navigation Template
 *
 * Renders the tabbed navigation for the account area.
 *
 * @package AmbassadorHub\Accounts\Blocks\Account
 *
 * @var array  $tabs        Available tabs.
 * @var string $current_tab Current active tab.
 */

use AmbassadorHub\Accounts\Blocks\Account\Router;

defined( 'ABSPATH' ) || exit;
?>

<nav class="ambassador-account__navigation" role="navigation" aria-label="<?php echo esc_attr__( 'Account navigation', 'ambassadorhub' ); ?>">
	<ul class="ambassador-account__nav-list">
		<?php foreach ( $tabs as $ambh_tab_id => $ambh_tab ) : ?>
			<?php
			$ambh_is_active = $ambh_tab_id === $current_tab;
			$ambh_url       = Router::get_tab_url( $ambh_tab_id );
			?>
			<li class="ambassador-account__nav-item <?php echo $ambh_is_active ? 'is-active' : ''; ?>">
				<a 
					href="<?php echo esc_url( $ambh_url ); ?>" 
					class="ambassador-account__nav-link"
					<?php echo $ambh_is_active ? 'aria-current="page"' : ''; ?>
				>
					<?php echo esc_html( $ambh_tab['label'] ); ?>
				</a>
			</li>
		<?php endforeach; ?>
	</ul>
</nav>
