<?php
// pages/components/notification_common.php
// Common notification bar component
// All inline HTML is captured with output buffering
// Usage:
//   // optionally set before include:
//   // $message = '...'; $linkLabel = '...'; $href = '...';
//   include BEEZUI_ROOT . '/pages/components/notification_common.php';

$linkLabel = mh_lng('MH_BUTTON_BACK') . ' MailBeez V4';

//echo mh_session('language_code', 'en');

if (mh_session('language_code') == 'de') {
    $message = 'MailBeez V5 Vorschau-Version mit begrenztem Funktionsumfang';
} else {
    $message = 'MailBeez V5 Preview Version with limited features';
}


// Defaults (can be overridden by defining these vars before including this file)
$message   = isset($message) ? (string)$message : 'A new software update is available. See what’s new in version 2.0.4.';
$linkLabel = isset($linkLabel) ? (string)$linkLabel : 'Details';
$href      = isset($href) ? (string)$href : \Components\Router::url('switch_to_legacy', ['partial' => 1]);

$margin = isset($margin) ? (bool)$margin : true;

echo \Components\Notification::render($message, [
    'linkLabel' => $linkLabel,
    'href' => $href,
    'id' => 'v5_preview_notice', // Unique ID for this specific notification
    'dismissible' => false,
    'size' => 'xs',
    'margin' => $margin,
]);
