diff --git a/apps/dispatch/app/(dispatch)/_components/ChangeRufgruppe.tsx b/apps/dispatch/app/(dispatch)/_components/ChangeRufgruppe.tsx new file mode 100644 index 00000000..8a3b0ca9 --- /dev/null +++ b/apps/dispatch/app/(dispatch)/_components/ChangeRufgruppe.tsx @@ -0,0 +1,31 @@ +"use client"; + +export const ChangeRufgruppe = () => { + return ( + <> +
+ + + + +
1
+
+ +
+ + ); +}; diff --git a/apps/dispatch/app/(dispatch)/_components/Map.tsx b/apps/dispatch/app/(dispatch)/_components/Map.tsx new file mode 100644 index 00000000..29145eb4 --- /dev/null +++ b/apps/dispatch/app/(dispatch)/_components/Map.tsx @@ -0,0 +1,27 @@ +"use client" +import { useEffect, useRef } from "react"; + +import L from "leaflet"; +import "leaflet/dist/leaflet.css"; + +export default () => { + const mapRef = useRef(null); + + useEffect(() => { + if (!mapRef.current) return; + + // Initialisiere die Leaflet-Karte + const map = L.map(mapRef.current).setView([51.1657, 10.4515], 6); // Deutschland + + // OpenStreetMap Tile Layer hinzufügen + L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { + attribution: '© OSM contributors', + }).addTo(map); + + return () => { + map.remove(); // Karte beim Unmounten bereinigen + }; + }, []); + return
; + +} \ No newline at end of file diff --git a/apps/dispatch/app/(dispatch)/_components/Navbar.tsx b/apps/dispatch/app/(dispatch)/_components/Navbar.tsx new file mode 100644 index 00000000..54e9d419 --- /dev/null +++ b/apps/dispatch/app/(dispatch)/_components/Navbar.tsx @@ -0,0 +1,64 @@ +"use client"; +import "../globals.css"; +import { ToggleTalkButton } from "../_components/ToggleTalkButton"; +import { ChangeRufgruppe } from "../_components/ChangeRufgruppe"; +import { Notifications } from "../_components/Notifications"; + +export default function Navbar() { + return ( +
+
+ VAR Leitstelle V2 +
+
+
    +
  • + +
  • +
  • + +
  • +
+
+
+ +
+
+ +
+
... + +
+ +
+
+
+ ); +} diff --git a/apps/dispatch/app/(dispatch)/_components/Notifications.tsx b/apps/dispatch/app/(dispatch)/_components/Notifications.tsx new file mode 100644 index 00000000..a2ad92df --- /dev/null +++ b/apps/dispatch/app/(dispatch)/_components/Notifications.tsx @@ -0,0 +1,28 @@ +"use client"; + +export const Notifications = () => { + return ( + <> +
+ +
+99
+
+ +
+ + ); +}; \ No newline at end of file diff --git a/apps/dispatch/app/(dispatch)/_components/ToggleTalkButton.tsx b/apps/dispatch/app/(dispatch)/_components/ToggleTalkButton.tsx new file mode 100644 index 00000000..b33a0f6e --- /dev/null +++ b/apps/dispatch/app/(dispatch)/_components/ToggleTalkButton.tsx @@ -0,0 +1,28 @@ +"use client"; +import { useTalkStore } from "../_store/useTalkStore"; + +export const ToggleTalkButton = () => { + const { isTalking, toggleTalking } = useTalkStore(); + + return ( + + ); +}; \ No newline at end of file diff --git a/apps/dispatch/app/(dispatch)/layout.tsx b/apps/dispatch/app/(dispatch)/layout.tsx new file mode 100644 index 00000000..1b205990 --- /dev/null +++ b/apps/dispatch/app/(dispatch)/layout.tsx @@ -0,0 +1,22 @@ +import type { Metadata } from "next"; +import Navbar from "./_components/Navbar"; + +export const metadata: Metadata = { + title: "VAR Leitstelle v2", + description: "Die neue VAR Leitstelle.", +}; + +export default function RootLayout({ + children, +}: Readonly<{ + children: React.ReactNode; +}>) { + return ( + + + + {children} + + + ); +} diff --git a/apps/dispatch/app/(dispatch)/page.tsx b/apps/dispatch/app/(dispatch)/page.tsx new file mode 100644 index 00000000..5de19b9d --- /dev/null +++ b/apps/dispatch/app/(dispatch)/page.tsx @@ -0,0 +1,8 @@ +"use client" +import dynamic from "next/dynamic" +const MyAwesomeMap = dynamic(() => import("./_components/Map"), { ssr: false }) + +export default () => { + + return +} \ No newline at end of file diff --git a/apps/dispatch/app/_components/Navbar.tsx b/apps/dispatch/app/_components/Navbar.tsx deleted file mode 100644 index 195555bd..00000000 --- a/apps/dispatch/app/_components/Navbar.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import "../globals.css"; - -export default function Navbar() { - return ( -
-
- daisyUI -
-
- -
-
-
- Tailwind CSS Navbar component -
-
- -
-
-
- ); -} diff --git a/apps/dispatch/app/_store/useTalkStore.ts b/apps/dispatch/app/_store/useTalkStore.ts new file mode 100644 index 00000000..c5624288 --- /dev/null +++ b/apps/dispatch/app/_store/useTalkStore.ts @@ -0,0 +1,11 @@ +import { create } from "zustand"; + +type TalkState = { + isTalking: boolean; + toggleTalking: () => void; +}; + +export const useTalkStore = create((set) => ({ + isTalking: false, + toggleTalking: () => set((state) => ({ isTalking: !state.isTalking })), +})); \ No newline at end of file diff --git a/apps/dispatch/app/layout.tsx b/apps/dispatch/app/layout.tsx index d6a53e5b..e5269389 100644 --- a/apps/dispatch/app/layout.tsx +++ b/apps/dispatch/app/layout.tsx @@ -1,7 +1,6 @@ import type { Metadata } from "next"; import localFont from "next/font/local"; import "./globals.css"; -import Navbar from "./_components/Navbar"; const geistSans = localFont({ src: "./fonts/GeistVF.woff", @@ -25,7 +24,6 @@ export default function RootLayout({ return ( - {children} diff --git a/apps/dispatch/app/login/page.tsx b/apps/dispatch/app/login/page.tsx new file mode 100644 index 00000000..0cc4a61a --- /dev/null +++ b/apps/dispatch/app/login/page.tsx @@ -0,0 +1,5 @@ +import { redirect } from "next/navigation"; + +export default function Login() { + redirect("/"); +} \ No newline at end of file diff --git a/apps/dispatch/app/page.tsx b/apps/dispatch/app/page.tsx deleted file mode 100644 index 8cdb9ab0..00000000 --- a/apps/dispatch/app/page.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import { Button } from "@repo/ui/button"; -import styles from "./page.module.css"; - -export default function Home() { - return ( -
Test
- ); -} diff --git a/apps/dispatch/package.json b/apps/dispatch/package.json index f1f4e109..0abfcf0e 100644 --- a/apps/dispatch/package.json +++ b/apps/dispatch/package.json @@ -13,15 +13,18 @@ "dependencies": { "@repo/ui": "*", "@tailwindcss/postcss": "^4.0.2", + "leaflet": "^1.9.4", "next": "^15.1.0", "postcss": "^8.5.1", "react": "^19.0.0", "react-dom": "^19.0.0", - "tailwindcss": "^4.0.2" + "tailwindcss": "^4.0.2", + "zustand": "^5.0.3" }, "devDependencies": { "@repo/eslint-config": "*", "@repo/typescript-config": "*", + "@types/leaflet": "^1.9.16", "@types/node": "^20", "@types/react": "18.3.1", "@types/react-dom": "18.3.0",