<?php
use Components\Base;
use Components\Button;

$changelogUrl = mh_saas() ? '' : mh_language_documentation_url('https://www.mailbeez.com/documentation/changelog');
$changelogBtn = '';
if ($changelogUrl) {
    $changelogBtn = Button::render(mh_lng('MH_CHANGELOG_TEXT', 'What\'s new?'), [
        'variant' => 'ghost',
        'size' => 'xs',
//        'icon' => Base::SVG_OUTLINE_DOCUMENT_TEXT,
        'iconPosition' => 'front',
        'attrs' => [
            'command' => 'show-modal',
            'commandfor' => 'config-modal',
            'data-width' => '3xl',
            'data-height' => '95vh',
            'data-url' => $changelogUrl,
            'hx-target' => '#config-modal-body',
            'hx-swap' => 'innerHTML',
            'title' => mh_lng('MH_CHANGELOG_TEXT', 'What\'s new?'),
        ],
    ]);
}
?>
<div class="w-full h-full ">
    <!-- common notification -->
    <div class="flex  items-center gap-2">
        <div class="flex-1 text-nowrap">
            <?php 
                $margin = false;
                include BEEZUI_ROOT . '/pages/components/notification_common.php'; 
            ?>
        </div>
        <div class=" grow items-center pl-8">
            <?php echo $changelogBtn; ?>
            <?php if (!mh_saas()) : ?>
            <?php include BEEZUI_ROOT . 'pages/components/updates.php'; ?>
            <?php endif; ?>
        </div>

        <div class="pr-0.5">
            <?php include BEEZUI_ROOT . 'pages/components/mode.php'; ?>
        </div>

    <!-- common notification -->
    </div>
</div>
