<?php
/**
 * Template for AI Memory control in products list
 *
 * @package SAAI
 * @var int    $product_id   Product ID
 * @var bool   $is_enabled   Whether AI memory is enabled
 * @var string $status_icon  Status icon HTML
 * @var string $hover_text   Hover text for status indicator
 */

defined( 'ABSPATH' ) || exit;
?>

<div class="saai-ai-memory-control" data-product-id="<?php echo esc_attr( $product_id ); ?>">
    <label class="saai-switch">
        <input type="checkbox" 
                class="saai-ai-memory-toggle" 
                <?php checked( $is_enabled ); ?>
                data-product-id="<?php echo esc_attr( $product_id ); ?>">
        <span class="saai-slider"></span>
    </label>
    <?php if ( $status_icon ) : ?>
    <span class="saai-status-indicator" data-saai-tooltip="<?php echo esc_attr( $hover_text ); ?>">
        <?php echo $status_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
    </span>
    <?php endif; ?>
</div>
