<?php
/**
 * File Path: includes/blocks/class-mbs-block-bestseller.php
 *
 * mbs/bestseller Block Render -- DISPLAY-2
 *
 * PHP render_callback for the mbs/bestseller Gutenberg block.
 * Delegates to MBS_Shortcode_Bestseller::render(). PRO-gated.
 *
 * Attributes:
 *   limit  (number)  -- Max books. Default 10.
 *   layout (string)  -- Layout slug. Default "grid".
 *
 * @package    My_Book_Showroom
 * @subpackage Includes/Blocks
 * @since      1.0.0
 */

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

/**
 * Class MBS_Block_Bestseller
 *
 * @since 1.0.0
 */
class MBS_Block_Bestseller {

	/**
	 * Render the mbs/bestseller block.
	 *
	 * @param array $attributes Block attribute values.
	 * @return string Rendered HTML.
	 */
	public static function render( array $attributes ): string {
		return MBS_Shortcode_Bestseller::render( array(
			'limit'  => (int) ( $attributes['limit']  ?? 10 ),
			'layout' => (string) ( $attributes['layout'] ?? 'grid' ),
		) );
	}
}
