<?php
use App\Core\Config;
use App\Core\Session;
use App\Core\Version;

$appName = Config::get('APP_NAME', 'Darlink ERP');
$flashSuccess = Session::flash('success');
$flashInfo = Session::flash('info');
$flashWarning = Session::flash('warning');
$flashError = Session::flash('error');
?>
<!doctype html>
<html lang="fr">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="robots" content="noindex, nofollow, noarchive, nosnippet, noimageindex">
    <meta name="googlebot" content="noindex, nofollow, noarchive, nosnippet, noimageindex">
    <meta name="bingbot" content="noindex, nofollow, noarchive, nosnippet, noimageindex">
    <title><?= htmlspecialchars($title ?? $appName) ?></title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="assets/css/darlink.css" rel="stylesheet">
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
</head>
<body class="darlink-auth-body">
    <div class="darlink-auth-notifications" aria-live="polite">
        <?php if ($flashSuccess): ?>
            <div class="alert alert-success darlink-notification darlink-auth-flash" role="status" data-darlink-notification data-notification-type="success">
                <span><?= htmlspecialchars($flashSuccess) ?></span>
                <button type="button" class="btn-close" aria-label="Fermer" data-notification-close></button>
                <span class="darlink-notification-progress" aria-hidden="true"></span>
            </div>
        <?php endif; ?>
        <?php if ($flashInfo): ?>
            <div class="alert alert-info darlink-notification darlink-auth-flash" role="status" data-darlink-notification data-notification-type="info">
                <span><?= htmlspecialchars($flashInfo) ?></span>
                <button type="button" class="btn-close" aria-label="Fermer" data-notification-close></button>
                <span class="darlink-notification-progress" aria-hidden="true"></span>
            </div>
        <?php endif; ?>
        <?php if ($flashWarning): ?>
            <div class="alert alert-warning darlink-notification darlink-auth-flash" role="alert" data-darlink-notification data-notification-type="warning">
                <span><?= htmlspecialchars($flashWarning) ?></span>
                <button type="button" class="btn-close" aria-label="Fermer" data-notification-close></button>
                <span class="darlink-notification-progress" aria-hidden="true"></span>
            </div>
        <?php endif; ?>
        <?php if ($flashError): ?>
            <div class="alert alert-danger darlink-notification darlink-auth-flash" role="alert" data-darlink-notification data-notification-type="error">
                <span><?= htmlspecialchars($flashError) ?></span>
                <button type="button" class="btn-close" aria-label="Fermer" data-notification-close></button>
            </div>
        <?php endif; ?>
    </div>
    <?php require $viewFile; ?>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
    <script src="assets/js/notifications.js"></script>
</body>
</html>
