<?php
/**
 * Shared navigation tabs for Blocked in China admin templates.
 *
 * Expects $current_tab to be set before including this file.
 *
 * @package BlockedInChina
 */

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

global $bic_fs;

$bic_is_personal = $bic_fs->is_plan( 'personal', true );
$bic_is_pro      = $bic_fs->is_plan( 'pro', true );
$bic_is_agency   = $bic_fs->is_plan( 'agency', true );
$bic_is_paid     = $bic_is_personal || $bic_is_pro || $bic_is_agency;

// Log requires Personal plan or higher
$log_badge      = ! $bic_is_paid ? ' <span class="bic-tab-badge" style="background:#2563eb;color:#fff;font-size:10px;padding:1px 6px;border-radius:8px;margin-left:4px;">Personal</span>' : '';
// Schedule requires Pro plan or higher
$schedule_badge = ! ( $bic_is_pro || $bic_is_agency ) ? ' <span class="bic-tab-badge" style="background:#2563eb;color:#fff;font-size:10px;padding:1px 6px;border-radius:8px;margin-left:4px;">Pro</span>' : '';
?>
<nav class="nav-tab-wrapper">
	<a href="?page=blocked-in-china" class="nav-tab <?php echo ( $current_tab === 'status' ) ? 'nav-tab-active' : ''; ?>">
		<?php esc_html_e( 'Status', 'blocked-in-china' ); ?>
	</a>
	<a href="?page=blocked-in-china&tab=log" class="nav-tab <?php echo ( $current_tab === 'log' ) ? 'nav-tab-active' : ''; ?>">
		<?php esc_html_e( 'Log', 'blocked-in-china' ); ?><?php echo $log_badge; ?>
	</a>
	<a href="?page=blocked-in-china&tab=schedule" class="nav-tab <?php echo ( $current_tab === 'schedule' ) ? 'nav-tab-active' : ''; ?>">
		<?php esc_html_e( 'Schedule', 'blocked-in-china' ); ?><?php echo $schedule_badge; ?>
	</a>
	<a href="?page=blocked-in-china&tab=bundle" class="nav-tab <?php echo ( $current_tab === 'bundle' ) ? 'nav-tab-active' : ''; ?>">
		⭐ <?php esc_html_e( 'China Plugins Bundle', 'blocked-in-china' ); ?> ⭐
	</a>
</nav>
