<div class="wrap">
    <h1><?php echo esc_html(get_admin_page_title()); ?></h1>
    <div class="kd-wrap">
        
        <?php
        $active_tab = isset($_GET['tab']) ? sanitize_text_field(wp_unslash($_GET['tab'])) : 'general';
        ?>

        <h2 class="nav-tab-wrapper">
            <a href="?page=rss-chimp&tab=start" class="nav-tab <?php echo $active_tab === 'start' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e('Start', 'rss-chimp'); ?></a>
            <a href="?page=rss-chimp&tab=general" class="nav-tab <?php echo $active_tab === 'general' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e('General', 'rss-chimp'); ?></a>
            <?php if (rss_chimp_fs()->is__premium_only() && rss_chimp_fs()->is_plan('pro', true)) { ?>
                <a href="?page=rss-chimp&tab=feeds" class="nav-tab <?php echo $active_tab === 'feeds' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e('Feeds', 'rss-chimp'); ?></a>
            <?php } ?>
        </h2>

        <div class="kd-content">
            <form action="options.php" method="post">
                <?php
                settings_errors();
                wp_nonce_field('rss_chimp_save_settings', 'rss_chimp_nonce');

                if ($active_tab === 'start') {
                    include 'rss-chimp-tab-start.php';
                } elseif ($active_tab === 'general') {
                    include 'rss-chimp-tab-general.php';
                } elseif ($active_tab === 'feeds' && rss_chimp_fs()->is__premium_only() && rss_chimp_fs()->is_plan('pro', true)) {
                    include 'rss-chimp-tab-feeds.php';
                }
                ?>
            </form>
        </div>

        <?php include 'rss-chimp-admin-sidebar.php'; ?>
    </div>
</div>