<?php
/**
 * Affiliate Dashboard Template
 *
 * Renders the affiliate dashboard container with data attributes for the React app.
 *
 * @since 2.15.0
 *
 * @package wc-affiliate
 * @var int $user_id Current user ID
 * @var bool $is_active_affiliate Whether the user is an active affiliate
 * @var array $atts Shortcode attributes
 */

if ( current_user_can( 'manage_options' ) ) : ?>
	<div style="background-color: #fffaf0; border: 1px solid #ffb93b; color: #db8d00; border-radius: 8px; width: 100%; padding: 16px; margin-bottom: 20px;">
		<?php _e( "Note: This section is intended for 'Affiliates Use' only and is shown here for admins' preview purposes.", 'wc-affiliate' ); ?>
	</div>
<?php endif; ?>

<div id="wc-affiliate-dashboard"
	class="wc-affiliate-dashboard"
	data-is-logged-in="true"
	data-current-user-id="<?php echo esc_attr( $user_id ); ?>"
	data-is-active-affiliate="<?php echo esc_attr( $is_active_affiliate ? 'true' : 'false' ); ?>"
	data-attrs="<?php echo esc_attr( wp_json_encode( $atts ) ); ?>"
></div>
