StationStatus Toast hinzugefügt #45

This commit is contained in:
PxlLoewe
2025-07-07 01:55:45 -07:00
parent 7682f191c7
commit 9e4a46c595
13 changed files with 170 additions and 140 deletions

View File

@@ -2,7 +2,7 @@
"use client";
import { toast } from "react-hot-toast";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { QueryClient, QueryClientProvider, useQuery } from "@tanstack/react-query";
import { ReactNode, useEffect, useState } from "react";
import { dispatchSocket } from "(app)/dispatch/socket";
import { Mission, NotificationPayload } from "@repo/db";
@@ -10,9 +10,11 @@ import { HPGnotificationToast } from "_components/customToasts/HPGnotification";
import { useMapStore } from "_store/mapStore";
import { AdminMessageToast } from "_components/customToasts/AdminMessage";
import { pilotSocket } from "(app)/pilot/socket";
import { StatusToast } from "_components/customToasts/StationStatusToast";
export function QueryProvider({ children }: { children: ReactNode }) {
const mapStore = useMapStore((s) => s);
const [queryClient] = useState(
() =>
new QueryClient({
@@ -73,6 +75,12 @@ export function QueryProvider({ children }: { children: ReactNode }) {
duration: 999999,
});
break;
case "station-status":
if (notification.status !== "5") return;
toast.custom((e) => <StatusToast event={notification} t={e} />, {
duration: 99999999 /* 30000 */,
});
break;
default:
toast("unbekanntes Notification-Event");
break;