<?php
// pages/newsletter.php
require_once BEEZUI_ROOT . '/components/index.php';
require_once BEEZUI_ROOT . '/pages/layout.php';

use Components\Card;

$pageKey = 'datasources';
$targetContainer = '';
ob_start();
?>
<div>
  <?php echo \Components\Ui\PageHeader::render('Datasources'); ?>
</div>
    <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
        <?php
        $items = \Components\Data\DataRegistry::datasources()->datasources();
        foreach ($items as $it) {
            $title = $it['title'] ?? '';
            $body  = $it['body_html'] ?? '';
            $icon  = $it['icon_svg'] ?? null;
            echo Card::render($title, $body, $icon);
        }
        ?>
    </div>
<?php
$content = ob_get_clean();

echo layout($pageKey, $content);
