<?php
/**
 * Shared page header partial.
 *
 * @package    100Prints
 */

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

$title = isset( $args['title'] ) ? $args['title'] : '100Prints';
$actions = isset( $args['actions'] ) && is_array( $args['actions'] ) ? $args['actions'] : [];
?>

<header class="hundredp-page-header">
	<h1><?php echo esc_html( $title ); ?></h1>
	<div class="hundredp-page-header-right">
		<?php if ( ! empty( $actions ) ) : ?>
			<nav class="hundredp-header-actions" aria-label="<?php esc_attr_e( '100Prints sections', '100prints' ); ?>">
				<?php foreach ( $actions as $action ) : ?>
					<a class="hundredp-btn hundredp-btn-ghost" href="<?php echo esc_url( $action['url'] ); ?>">
						<?php if ( ! empty( $action['icon'] ) ) : ?>
							<i class="ph-bold <?php echo esc_attr( $action['icon'] ); ?>"></i>
						<?php endif; ?>
						<?php echo esc_html( $action['label'] ); ?>
					</a>
				<?php endforeach; ?>
			</nav>
		<?php endif; ?>
		<?php
		// Load status bar partial
		require HUNDRED_PRINTS_PATH . 'admin/partials/status-bar.php';
		?>
	</div>
</header>
