setUsername(e.target.value)}
- className="w-full bg-slate-900 border border-slate-700 rounded-lg p-3 text-white focus:ring-2 focus:ring-blue-500 outline-none"
- />
+
+
+
+
+
+
+
+ {t('title')}
+
+
{t('login_subtitle')}
+
+
+ {error && (
+
+ {error}
+ )}
+
+
diff --git a/frontend/src/pages/UserDashboard.jsx b/frontend/src/pages/UserDashboard.jsx
index 6ba2d50..5459637 100644
--- a/frontend/src/pages/UserDashboard.jsx
+++ b/frontend/src/pages/UserDashboard.jsx
@@ -2,11 +2,14 @@ import { useState, useEffect } from 'react';
import axios from 'axios';
import { Car, Clock, CheckCircle, AlertCircle, Users, Trash2, PlusCircle, UserPlus, AlertTriangle } from 'lucide-react';
import io from 'socket.io-client';
+import { useTranslation } from 'react-i18next';
+import LanguageSelector from '../components/LanguageSelector';
const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:3000';
const socket = io(API_URL);
function UserDashboard({ token, username }) {
+ const { t } = useTranslation();
const [plates, setPlates] = useState([]);
const [newPlate, setNewPlate] = useState({ number: '', owner: '' });
const [detections, setDetections] = useState([]);
@@ -91,7 +94,7 @@ function UserDashboard({ token, username }) {
};
const handleDeletePlate = async (id) => {
- if (!confirm('Are you sure you want to delete this plate?')) return;
+ if (!confirm(t('confirm_delete_plate'))) return;
try {
await axios.delete(`${API_URL}/api/plates/${id}`, {
headers: { Authorization: `Bearer ${token}` }
@@ -103,7 +106,7 @@ function UserDashboard({ token, username }) {
};
const handleDeletePerson = async (id) => {
- if (!confirm('Are you sure you want to delete this visitor?')) return;
+ if (!confirm(t('confirm_delete_visitor'))) return;
try {
await axios.delete(`${API_URL}/api/people/${id}`, {
headers: { Authorization: `Bearer ${token}` }
@@ -118,48 +121,51 @@ function UserDashboard({ token, username }) {