Wartungsmodus funktional #9

This commit is contained in:
nocnico
2025-07-03 21:23:37 +02:00
parent 84d326ddf5
commit 44d51cd1a8
4 changed files with 98 additions and 12 deletions

View File

@@ -11,6 +11,10 @@ const fetchMainMessage = async () => {
export const WarningAlert = async () => {
const mainMessage = await fetchMainMessage();
if (mainMessage?.showUntilActive && new Date(mainMessage.showUntil) < new Date()) {
return <></>;
}
let msgColor;
switch (mainMessage?.color) {
case "WARNING":
@@ -29,13 +33,15 @@ export const WarningAlert = async () => {
msgColor = "alert alert-soft ml-3 py-2 flex items-center gap-2";
}
if (mainMessage?.message == "" || !mainMessage) {
if ((mainMessage?.message == "" && !mainMessage?.wartungsmodus) || !mainMessage) {
return <></>;
} else {
return (
<div role="alert" className={msgColor}>
<MessageCircleWarning />
<span className="font-bold m-0">{mainMessage?.message}</span>
<span className="font-bold m-0">
{mainMessage?.wartungsmodus ? "Wartungsmodus aktiv!" : mainMessage?.message}
</span>
</div>
);
}