<?php
/**
 * Product description step 11 language template.
 *
 * @package SAAI
 */

if ( ! defined( 'ABSPATH' ) ) {
    die( 'You are not allowed to call this page directly.' );
}

use SAAI\Helpers\Helper;

// Get available languages.
$languages = Helper::get_data_options()['languages'];

?>

<div class="saai-product-description-form-step saai-product-description-form-step-11 <?php echo $language ? 'valid' : ''; ?>" data-step="11">
    <h3><?php esc_html_e( 'Language Selection', 'storeagent-ai-for-woocommerce' ); ?></h3>
    <div class="saai-product-description-form-step-content">
        <div class="saai-product-description-form-field">
            <label for="saai-product-description-form-field-language"><?php esc_html_e( 'In which language would you like to generate the product description?', 'storeagent-ai-for-woocommerce' ); ?></label>
            <select id="saai-product-description-form-field-language" name="language" class="saai-language-select">
                <option value=""><?php esc_html_e( 'Select a language', 'storeagent-ai-for-woocommerce' ); ?></option>
                <?php foreach ( $languages as $code => $label ) : ?>
                    <option value="<?php echo esc_attr( $code ); ?>" <?php selected( $language, $code ); ?>>
                        <?php echo esc_html( $label ); ?>
                    </option>
                <?php endforeach; ?>
            </select>
            <p class="saai-field-description">
                <?php esc_html_e( 'Choose "Default language" to generate content in your site\'s default language, or select a specific language for this product description.', 'storeagent-ai-for-woocommerce' ); ?>
            </p>
        </div>

        <div class="saai-product-description-step-actions-field">
            <button type="button" class="button previous-step-button">
                <?php esc_html_e( 'Back', 'storeagent-ai-for-woocommerce' ); ?>
            </button>
        </div>
    </div>
</div>
