diff --git a/src/App.tsx b/src/App.tsx index 646c0a6..1ed0a7c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,6 +1,19 @@ -import { Camera } from 'lucide-react' +import { Camera, Radio } from 'lucide-react' +import { useSSE } from './hooks/useSSE' +import { useCameraStore } from './store/useCameraStore' +import { CameraCard } from './components' function App() { + // Connect to SSE endpoint — auto-updates the camera store + useSSE() + + // Subscribe to the camera store for reactivity. + // getCameras / getOnlineCount / getRecordingCount pull from live state. + const { getCameras, getOnlineCount, getRecordingCount } = useCameraStore() + const cameras = getCameras() + const onlineCount = getOnlineCount() + const recordingCount = getRecordingCount() + return (
{/* Header */} @@ -14,21 +27,58 @@ function App() { Dashboard + + {/* Stats badges */} +
+ {/* Online count */} + + + {onlineCount} online + + + {/* Recording count */} + + + + + + {recordingCount} recording + +
{/* Main Content */}
-
- -

- Dashboard Coming Soon -

-

- Camera monitoring and remote control interface — under construction. -

-
+ {cameras.length === 0 ? ( + /* Empty state */ +
+ + + +

+ Waiting for cameras… +

+

+ Connect cameras to your RemoteRig server and they will appear here + automatically. +

+
+ ) : ( + /* Camera grid */ +
+ {cameras.map((camera) => ( + + ))} +
+ )}
{/* Footer */}