<?php
// phpcs:ignoreFile
if ( ! defined( 'ABSPATH' ) ) { exit; }

use LolaCore\Admin\McpConfigGenerator;

$clients = McpConfigGenerator::getClients();
?>
<div id="lc-mcp-configs-container" class="lc-mcp-configs-container" style="display: none; margin-top: 24px;">
    <span class="lc-mcp-eyebrow">02 &middot; <?php esc_html_e( 'Copy Your Config', 'lolacore' ); ?></span>
    
    <div class="lc-mcp-config-tabs">
        <?php $first = true; foreach ( $clients as $key => $client ) : ?>
            <button type="button" class="lc-mcp-config-tab-btn <?php echo $first ? 'is-active' : ''; ?>" data-target="lc-mcp-config-pane-<?php echo esc_attr( $key ); ?>">
                <?php echo esc_html( $client['name'] ); ?>
            </button>
        <?php $first = false; endforeach; ?>
    </div>
    
    <div class="lc-mcp-config-panes">
        <?php $first = true; foreach ( $clients as $key => $client ) : ?>
            <div id="lc-mcp-config-pane-<?php echo esc_attr( $key ); ?>" class="lc-mcp-config-pane <?php echo $first ? 'is-active' : ''; ?>">
                <div class="lc-mcp-config-card__header">
                    <span class="lc-mcp-config-card__filename"><?php echo esc_html( $client['filename'] ); ?></span>
                    <button type="button" class="lc-mcp-button lc-mcp-button--ghost lc-mcp-copy-btn" data-target="config-<?php echo esc_attr( $key ); ?>">
                        <?php esc_html_e( 'Copy JSON', 'lolacore' ); ?>
                    </button>
                </div>
                <pre class="lc-mcp-config-card__code"><code id="config-<?php echo esc_attr( $key ); ?>" data-template="<?php echo esc_attr( $client['template'] ); ?>"></code></pre>
            </div>
        <?php $first = false; endforeach; ?>
    </div>
</div>
