<?php
/**
 * Main settings page template
 *
 * @package Ilabs\Firevert\Core\Settings\UI
 *
 * @var string $title Page title
 * @var string $active_tab Currently active tab
 * @var array $content_data Data for the content area with structure:
 *   [
 *     'type' => 'modules'|'group',
 *     'modules_data' => [...],
 *     'module_settings' => [...],
 *     'group_data' => [...]
 *   ]
 */

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

<div class="wrap">
    <a href='https://sitecare.pl/' target='_blank' class='firevert-banner-container'>
        <img src="<?php echo esc_url(plugin_dir_url(__FILE__)).'../../resources/assets/img/sc_banner.jpg'; ?>"
             alt="Sitecare Banner"/>
    </a>
    <h1><?php echo esc_html($title); ?></h1>
    <?php firevert_view('layouts/settings-tabs.view.php', array('active_tab' => $active_tab)); ?>

    <div class="firevert-settings-content">
        <?php if (isset($content_data['type']) && 'modules' === $content_data['type']) : ?>
            <?php firevert_view('modules-overview.view.php', $content_data['modules_data']); ?>

            <?php if (isset($content_data['module_settings'])) : ?>
                <?php firevert_view('module-settings.view.php', $content_data['module_settings']); ?>
            <?php endif; ?>

        <?php elseif (isset($content_data['type']) && 'group' === $content_data['type']) : ?>
            <?php firevert_view('layouts/group-form.view.php', $content_data['group_data']); ?>
        <?php endif; ?>
    </div>
</div>
