<?php
/**
 * Buttons admin — tabbed shell (orange header + suite tabs).
 *
 * @package Rsmspark_Content_Widgets
 *
 * @var Rsmspark_Buttons_List_Table|null $table
 * @var array<string, mixed>        $settings
 */

defined( 'ABSPATH' ) || exit;

$active_tab = Rsmspark_Settings_Page::get_active_tab( Rsmspark_Buttons_Admin::PAGE_SLUG, 'buttons' );

$buttons_tabs = array(
	'buttons' => array(
		'label'    => __( 'All Buttons', 'rsm-content-widgets' ),
		'callback' => static function () use ( $table ) {
			require RSMSPARK_CONTENT_WIDGETS_PATH . 'admin/views/buttons-tab-list.php';
		},
	),
	'settings' => array(
		'label'    => __( 'Settings', 'rsm-content-widgets' ),
		'callback' => static function () use ( $settings ) {
			require RSMSPARK_CONTENT_WIDGETS_PATH . 'admin/views/buttons-tab-settings.php';
		},
	),
);
?>
<div class="wrap rsm-buttons-admin rsmspark-content-widgets-admin rsmspark-suite-admin-hub rsmspark-suite-ui">
	<?php
	Rsmspark_Admin_Header::render(
		__( 'Buttons', 'rsm-content-widgets' ),
		array( 'slug' => 'buttons' )
	);
	?>
	<?php
	Rsmspark_Settings_Page::render(
		array(
			'page_title'  => '',
			'menu_slug'   => Rsmspark_Buttons_Admin::PAGE_SLUG,
			'active_tab'  => $active_tab,
			'wrap_class'  => 'rsmspark-buttons-admin-tabs',
			'form_action' => '',
			'tabs'        => $buttons_tabs,
			'skip_wrap'   => true,
		)
	);
	?>
</div>
