<?php
/**
 * AI Alt Text settings tab.
 *
 * @package AIAltTextGenerator
 */

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

use AIAltTextGenerator\Capabilities;
use AIAltTextGenerator\Settings;

if ( ! Capabilities::canManage() ) {
	echo '<div class="wpps-ai-alt-notice wpps-ai-alt-notice--warning"><p>' . esc_html__( 'You do not have permission to manage settings.', 'wp-powersuite' ) . '</p></div>';
	return;
}

$has_key = Settings::hasApiKey();
?>
<?php if ( ! $has_key ) : ?>
	<div class="wpps-ai-alt-onboarding" id="wpps-ai-alt-onboarding">
		<div class="wpps-ai-alt-onboarding-inner">
			<h2 class="wpps-ai-alt-onboarding-title"><?php esc_html_e( 'Get started in 3 steps', 'wp-powersuite' ); ?></h2>
			<ol class="wpps-ai-alt-onboarding-steps">
				<li><?php esc_html_e( 'Choose your AI provider and paste an API key below.', 'wp-powersuite' ); ?></li>
				<li><?php esc_html_e( 'Turn on auto-generate on upload (optional).', 'wp-powersuite' ); ?></li>
				<li><?php esc_html_e( 'Open Bulk Generate to process missing or weak alt text.', 'wp-powersuite' ); ?></li>
			</ol>
		</div>
	</div>
<?php endif; ?>

<div class="wpps-ai-alt-settings-section" id="wpps-ai-alt-settings">
	<?php include __DIR__ . '/settings-form.php'; ?>
</div>
