<?php
/**
 * Admin-only notice shown in footer when no footer sections exist.
 * Requires: PufferGo_Footer_Data $data (injected by render_variants).
 *
 * @package PufferGo
 */

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

if ( empty( $data->sections ) && current_user_can( 'edit_theme_options' ) ) :
	$menus_url = admin_url( 'nav-menus.php?action=edit&menu=0' );
	$menu_id = function_exists( 'puffergo_resolve_menu_id' )
		? puffergo_resolve_menu_id( 'puffergo_footer', 'PufferGo Footer' )
		: 0;
	if ( $menu_id > 0 ) {
		$menus_url = admin_url( 'nav-menus.php?action=edit&menu=' . $menu_id );
	}
	?>
	<div class="lg:col-span-8 mt-16 lg:mt-0">
		<p class="text-xs text-neutral-400 italic">
			<?php
			printf(
				/* translators: %s: menu management URL */
				esc_html__( 'No footer sections configured. %sEdit footer menu%s', 'puffergo' ),
				'<a href="' . esc_url( $menus_url ) . '" class="underline hover:text-neutral-600">',
				'</a>'
			);
			?>
		</p>
	</div>
	<?php
endif; ?>
