<?php
/**
 * Branded orange admin header for RSM plugin hubs.
 *
 * @package Rsmspark_Suite
 */

defined( 'ABSPATH' ) || exit;

/**
 * Rsmspark_Admin_Header
 */
final class Rsmspark_Admin_Header {

	/**
	 * Render the suite admin header bar.
	 *
	 * @param string               $title   Plugin screen title (e.g. Forms).
	 * @param array<string, mixed> $options Optional: kicker, slug (BEM modifier).
	 * @return void
	 */
	public static function render( $title, array $options = array() ) {
		$kicker = isset( $options['kicker'] ) ? (string) $options['kicker'] : __( 'RSM Suite', 'rsm-content-widgets' );
		$slug   = isset( $options['slug'] ) ? sanitize_key( (string) $options['slug'] ) : '';
		$class  = 'rsmspark-suite-admin-header';

		if ( '' !== $slug ) {
			$class .= ' rsmspark-suite-admin-header--' . $slug;
		}
		?>
		<div class="<?php echo esc_attr( $class ); ?>">
			<div class="rsmspark-suite-admin-header__inner">
				<p class="rsmspark-suite-admin-header__kicker"><?php echo esc_html( $kicker ); ?></p>
				<h1 class="rsmspark-suite-admin-header__title"><?php echo esc_html( $title ); ?></h1>
			</div>
		</div>
		<?php
	}
}
