<?php
/**
 * Admin-only notice shown in header when PufferGo menu has no items.
 * Requires: PufferGo_Header_Data $data (injected by render_variants).
 *
 * @package PufferGo
 */

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

if ( empty( $data->has_menu ) && current_user_can( 'edit_theme_options' ) ) :
	$menus_url = admin_url( 'nav-menus.php?action=edit&menu=0' );
	// Try to link directly to the PufferGo Header menu.
	$menu_id = puffergo_resolve_menu_id( 'puffergo_primary', 'PufferGo Header' );
	if ( $menu_id > 0 ) {
		$menus_url = admin_url( 'nav-menus.php?action=edit&menu=' . $menu_id );
	}
	?>
	<span class="text-xs text-neutral-400 italic">
		<?php
		printf(
			/* translators: %s: menu management URL */
			esc_html__( 'No menu items. %sConfigure menu%s', 'puffergo' ),
			'<a href="' . esc_url( $menus_url ) . '" class="underline hover:text-neutral-600">',
			'</a>'
		);
		?>
	</span>
<?php endif; ?>
