diff --git a/apps/dispatch/app/_store/reportStore.ts b/apps/dispatch/app/_store/reportStore.ts new file mode 100644 index 00000000..3868b875 --- /dev/null +++ b/apps/dispatch/app/_store/reportStore.ts @@ -0,0 +1,16 @@ +import { create } from "zustand"; + +interface ReportStore { + ownId: null | string; + reportOpen: boolean; + setReportOpen: (open: boolean) => void; + setOwnId: (id: string) => void; +} + +export const useReportStore = create((set) => ({ + ownId: null, + reportOpen: false, + setReportOpen: (open: boolean) => set({ reportOpen: open }), + setOwnId: (id: string) => set({ ownId: id }), +})); +// TODO: implement logic for reports diff --git a/apps/dispatch/app/dispatch/_components/navbar/_components/Chat.tsx b/apps/dispatch/app/dispatch/_components/left/Chat.tsx similarity index 95% rename from apps/dispatch/app/dispatch/_components/navbar/_components/Chat.tsx rename to apps/dispatch/app/dispatch/_components/left/Chat.tsx index bf833c60..15dd0f62 100644 --- a/apps/dispatch/app/dispatch/_components/navbar/_components/Chat.tsx +++ b/apps/dispatch/app/dispatch/_components/left/Chat.tsx @@ -8,8 +8,10 @@ import { getDispatcher, } from "dispatch/_components/navbar/_components/action"; import { cn } from "helpers/cn"; +import { useReportStore } from "_store/reportStore"; export const Chat = () => { + const { setReportOpen } = useReportStore(); const { chatOpen, setChatOpen, @@ -63,9 +65,7 @@ export const Chat = () => { }, [addTabValue, chats]); return ( -
+
{Object.values(chats).some((c) => c.notification) && ( @@ -73,7 +73,7 @@ export const Chat = () => { +
+ {reportOpen && ( +
+
+
+ +
+
+
+ +
+ +
+
+
+ )} +
+ ); +}; diff --git a/apps/dispatch/app/dispatch/_components/navbar/Navbar.tsx b/apps/dispatch/app/dispatch/_components/navbar/Navbar.tsx index e600a43d..80a1c628 100644 --- a/apps/dispatch/app/dispatch/_components/navbar/Navbar.tsx +++ b/apps/dispatch/app/dispatch/_components/navbar/Navbar.tsx @@ -5,7 +5,6 @@ import { ThemeSwap } from "./_components/ThemeSwap"; import { Audio } from "./_components/Audio"; import { useState } from "react"; import { ExitIcon, ExternalLinkIcon } from "@radix-ui/react-icons"; -import { Chat } from "./_components/Chat"; import Link from "next/link"; export default function Navbar() { @@ -25,11 +24,6 @@ export default function Navbar() {
VAR Leitstelle V2
-
-
- -
-
diff --git a/apps/dispatch/app/dispatch/page.tsx b/apps/dispatch/app/dispatch/page.tsx index 02ea12c2..c3668993 100644 --- a/apps/dispatch/app/dispatch/page.tsx +++ b/apps/dispatch/app/dispatch/page.tsx @@ -4,6 +4,8 @@ import { Pannel } from "dispatch/_components/pannel/Pannel"; import { usePannelStore } from "_store/pannelStore"; import { cn } from "helpers/cn"; import dynamic from "next/dynamic"; +import { Chat } from "./_components/left/Chat"; +import { Report } from "./_components/left/Report"; const Map = dynamic(() => import("./_components/map/Map"), { ssr: false }); const DispatchPage = () => { @@ -12,6 +14,12 @@ const DispatchPage = () => {
{/* */}
+
+ +
+ +
+