<?php
/**
 * EventListing Shortcode
 *
 * Renders the public event listing container.
 * Usage: [rtrb_event_list]
 *
 * @package RadiusTheme\RadiusBooking\Shortcodes
 * @since   1.2.0
 */

namespace RadiusTheme\RadiusBooking\Shortcodes;

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

/**
 * Class EventListing
 */
class EventListing {

	/**
	 * Render the event listing shortcode output.
	 *
	 * @param array $atts Shortcode attributes.
	 *
	 * @return string HTML output.
	 */
	public static function output( $atts = array() ): string {
		$atts = shortcode_atts(
			array(
				'layout'   => 'grid',
				'per_page' => '9',
				'category' => '',
			),
			$atts,
			'rtrb_event_list'
		);

		return sprintf(
			'<div class="rtrb-event-listing" data-layout="%s" data-per-page="%s" data-category="%s"></div>',
			esc_attr( $atts['layout'] ),
			esc_attr( $atts['per_page'] ),
			esc_attr( $atts['category'] )
		);
	}
}
