diff --git a/.husky/pre-commit b/.husky/pre-commit index 26fc364..3160307 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,2 +1,4 @@ #!/usr/bin/env sh pnpm exec lint-staged +pnpm exec eslint . --max-warnings 4 +pnpm run typecheck diff --git a/next.config.ts b/next.config.ts index 5e891cf..03be024 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,7 +1,9 @@ import type { NextConfig } from 'next'; const nextConfig: NextConfig = { - /* config options here */ + images: { + domains: ['10.10.220.79'], + }, }; export default nextConfig; diff --git a/src/components/dashboard/camera-feed.tsx b/src/components/dashboard/camera-feed.tsx index 488ccf4..0bfd576 100644 --- a/src/components/dashboard/camera-feed.tsx +++ b/src/components/dashboard/camera-feed.tsx @@ -1,6 +1,6 @@ 'use client'; -import React from 'react'; +import { useState } from 'react'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; @@ -8,7 +8,13 @@ interface CameraFeedProps { isAutonomous: boolean; } +const CAMERA_STREAM_URL = + process.env.NEXT_PUBLIC_CAMERA_STREAM_URL || + 'http://10.10.220.79:8080/camera/stream'; + export function CameraFeed({ isAutonomous }: CameraFeedProps) { + const [error, setError] = useState(null); + return ( @@ -21,16 +27,36 @@ export function CameraFeed({ isAutonomous }: CameraFeedProps) {
-
-
- REC -
- {/* Crosshair overlay */} -
-
-
-
-

Flux vidéo simulé

+ {!error && CAMERA_STREAM_URL ? ( + <> + Flux caméra setError('Erreur de chargement du flux')} + /> +
+
+ REC +
+ {/* Crosshair overlay */} +
+
+
+
+ + ) : ( +
+

+ {error || 'Caméra non configurée'} +

+ {CAMERA_STREAM_URL && ( +

+ {CAMERA_STREAM_URL} +

+ )} +
+ )}