Path: blob/main/components/dashboard/src/org-admin/MaintenanceNotificationBanner.tsx
2499 views
/**1* Copyright (c) 2025 Gitpod GmbH. All rights reserved.2* Licensed under the GNU Affero General Public License (AGPL).3* See License.AGPL.txt in the project root for license information.4*/56import { FC } from "react";7import Alert from "../components/Alert";8import { useMaintenanceNotification } from "../data/maintenance-mode/maintenance-notification-query";9import { useMaintenanceMode } from "../data/maintenance-mode/maintenance-mode-query";10import { DEFAULT_MESSAGE } from "./MaintenanceNotificationCard";1112export const MaintenanceNotificationBanner: FC = () => {13const { isNotificationEnabled, notificationMessage } = useMaintenanceNotification();14const { isMaintenanceMode } = useMaintenanceMode();1516// if both maintenance mode and scheduled notification are enabled,17// only show the maintenance mode notification18if (isMaintenanceMode || !isNotificationEnabled) {19return null;20}2122const displayMessage = notificationMessage || DEFAULT_MESSAGE;2324return (25<Alert type="warning" className="mb-2">26<div className="flex items-center">27<span className="font-semibold">Scheduled Maintenance:</span>28<span className="ml-2">{displayMessage}</span>29</div>30</Alert>31);32};333435