<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Variables in scope (injected via mbs_get_template_part from imp-exp-ui.php).
 * @var bool   $is_registered
 * @var bool   $is_pro
 * @var string $nonce
 * @var string $template_url
 */
?>

		<!-- Panel: Export Books (PRO) -->
		<div id="mbs-panel-export"
		     class="mbs-imp-exp-panel"
		     role="tabpanel"
		     hidden>
			<h3><?php esc_html_e( 'Export Books', 'my-book-showroom' ); ?></h3>

			<?php if ( $is_pro ) : ?>

				<p class="mbs-panel-lead"><?php esc_html_e( 'Download your entire book catalog as a CSV or XLSX file — ready to open in Excel or import into another tool.', 'my-book-showroom' ); ?></p>

				<div class="mbs-export-actions">
					<button type="button"
					        id="mbs-export-xlsx-btn"
					        class="button button-primary"
					        data-nonce="<?php echo esc_attr( $nonce ); ?>">
						<?php esc_html_e( 'Export All Books as XLSX', 'my-book-showroom' ); ?>
					</button>
					<button type="button"
					        id="mbs-export-csv-btn"
					        class="button button-secondary"
					        data-nonce="<?php echo esc_attr( $nonce ); ?>">
						<?php esc_html_e( 'Export All Books as CSV', 'my-book-showroom' ); ?>
					</button>
				</div>

				<p class="description" style="margin-top:12px;">
					<?php esc_html_e( 'Need cover images too?', 'my-book-showroom' ); ?>
					<button type="button"
					        class="button-link mbs-panel-link"
					        data-panel="export-zip">
						<?php esc_html_e( 'Export Catalog + Media as ZIP &rarr;', 'my-book-showroom' ); ?>
					</button>
				</p>

			<?php else : ?>
				<?php MBS_Pro_Gate::comment( 'Export Books' ); ?>
				<div class="mbs-imp-exp-soon">
					<span class="dashicons dashicons-lock"></span>
					<p><?php esc_html_e( 'Book export requires a PRO license.', 'my-book-showroom' ); ?></p>
				</div>
			<?php endif; ?>
		</div><!-- #mbs-panel-export -->
