<?php
/**
 * Activation Wizard - Step 2: Basic Setup.
 *
 * @package PrimeLink
 */

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

$settings = \PrimeLink\Core\Rest\ImportRest::get_settings();
$admin_email = get_option( 'admin_email' );
$notify_email = $settings['notify_email'] ?? $admin_email;
$enable_logs = $settings['enable_logs'] ?? 0;
$default_iteration_size = $settings['default_iteration_size'] ?? 20;
?>
<div class="mt-primelink-wizard-step-inner">
    <div class="mt-primelink-wizard-icon">
        <span class="dashicons dashicons-admin-settings"></span>
    </div>
    <h2><?php esc_html_e( 'Basic Configuration', 'primelink' ); ?></h2>
    <p class="mt-primelink-wizard-description">
        <?php esc_html_e( 'Configure basic settings to get the best experience with PrimeLink.', 'primelink' ); ?>
    </p>

    <div class="mt-primelink-wizard-form">
        <div class="mt-primelink-wizard-form-group">
            <label for="wizard-notify-email" class="mt_primelink-label">
                <?php esc_html_e( 'Notification Email', 'primelink' ); ?>
            </label>
            <input 
                type="email" 
                id="wizard-notify-email" 
                class="mt-primelink-wizard-input" 
                placeholder="<?php esc_attr_e( 'your@email.com', 'primelink' ); ?>"
                value="<?php echo esc_attr( $notify_email ); ?>"
            />
            <small class="description mt-primelink-wizard-help">
                <?php esc_html_e( 'Receive email notifications when imports/exports complete or encounter errors.', 'primelink' ); ?>
            </small>
        </div>

        <div class="mt-primelink-wizard-form-group">
            <label for="wizard-iteration-size" class="mt_primelink-label">
                <?php esc_html_e( 'Default Batch Size', 'primelink' ); ?>
            </label>
            <input 
                type="number" 
                id="wizard-iteration-size" 
                class="mt-primelink-wizard-input" 
                min="1" 
                max="500" 
                value="<?php echo esc_attr( $default_iteration_size ); ?>"
            />
            <small class="description mt-primelink-wizard-help">
                <?php esc_html_e( 'Number of items to process per batch. Lower values use less memory but take longer.', 'primelink' ); ?>
            </small>
        </div>

        <div class="mt-primelink-wizard-form-group">
            <label class="mt_primelink-check">
                <input 
                    type="checkbox" 
                    id="wizard-enable-logs" 
                    class="mt-primelink-wizard-checkbox"
                    <?php checked( $enable_logs, 1 ); ?>
                />
                <span><?php esc_html_e( 'Enable detailed logging', 'primelink' ); ?></span>
            </label>
            <small class="description mt-primelink-wizard-help" style="display:block;margin-top:4px;">
                <?php esc_html_e( 'Log all import/export activities for debugging purposes.', 'primelink' ); ?>
            </small>
        </div>
    </div>
</div>









