<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
/**
 * Renders the HTML grid for the Export Tools section.
 */
class Sifency_Admin_Export_UI {
	private $theme_name;
	private $theme_slug;
	private $section_slug;

	public function __construct( $theme_name, $theme_slug, $section_slug ) {
		$this->theme_name   = $theme_name;
		$this->theme_slug   = $theme_slug;
		$this->section_slug = $section_slug;
	}

	public function render() {
		ob_start();
		?>
		<p class="csf-text-muted">
			<?php esc_html_e( "Use the 'Update' buttons to save fresh data to the server. Use the 'Download' buttons to get a copy of the currently saved file.", 'sifency-addons' ); ?>
		</p>
		<div class="sifency-export-grid">
			
			<div class="sifency-export-item">
				<h3><?php esc_html_e( 'Customizer Settings (.dat)', 'sifency-addons' ); ?></h3>
				<p><?php esc_html_e( 'Exports all WordPress Customizer settings.', 'sifency-addons' ); ?></p>
				<div class="sifency-button-group">
					<?php echo wp_kses_post( Sifency_Admin_Button_Generator::create_export_button( 'customizer', 'Update File', $this->section_slug ) ); ?>
					<?php echo wp_kses_post( Sifency_Admin_Button_Generator::create_download_button( 'customizer', 'Download' ) ); ?>
				</div>
			</div>
			<div class="sifency-export-item">
				<h3><?php esc_html_e( 'Widget Settings (.wie)', 'sifency-addons' ); ?></h3>
				<p><?php esc_html_e( 'Exports active widgets in the standard .wie format.', 'sifency-addons' ); ?></p>
				<div class="sifency-button-group">
					<?php echo wp_kses_post( Sifency_Admin_Button_Generator::create_export_button( 'widgets', 'Update File', $this->section_slug ) ); ?>
					<?php echo wp_kses_post( Sifency_Admin_Button_Generator::create_download_button( 'widgets', 'Download' ) ); ?>
				</div>
			</div>
			<div class="sifency-export-item">
				<h3><?php esc_html_e( 'Elementor Kit (.json)', 'sifency-addons' ); ?></h3>
				<p><?php esc_html_e( 'Exports global styles from the active Elementor Kit.', 'sifency-addons' ); ?></p>
				<div class="sifency-button-group">
					<?php echo wp_kses_post( Sifency_Admin_Button_Generator::create_export_button( 'elementor_kit', 'Update File', $this->section_slug ) ); ?>
					<?php echo wp_kses_post( Sifency_Admin_Button_Generator::create_download_button( 'elementor_kit', 'Download' ) ); ?>
				</div>
			</div>
		</div>
		<?php
		return ob_get_clean();
	}
}
