<?php
/**
 * Booking widget view — rendered by [playard] shortcode.
 * Variables available from parent scope: $atts (shortcode attributes).
 */
if ( ! defined( 'ABSPATH' ) ) exit;

// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound

$_config_arr           = playard_get_frontend_config();
$_config_arr['fields'] = sanitize_text_field( (string) ( $atts['field'] ?? '' ) );
$_config               = wp_json_encode( $_config_arr );
?>
<div
  id="playard-booking-widget"
  data-field-id="<?php echo esc_attr( $atts['field'] ?? '' ); ?>"
  data-config="<?php echo esc_attr( $_config ?: '{}' ); ?>"
></div>
