Correccion de dashboar usuarios y admins
This commit is contained in:
@@ -58,8 +58,8 @@ function UserDashboard({ token, username }) {
|
||||
<div className="min-h-screen bg-slate-900 text-slate-100 p-8">
|
||||
<div className="max-w-6xl mx-auto grid grid-cols-1 lg:grid-cols-3 gap-8">
|
||||
|
||||
{/* Left: Register & My Plates */}
|
||||
<div className="lg:col-span-2 space-y-8">
|
||||
{/* Register & My Plates (Full Width) */}
|
||||
<div className="col-span-1 lg:col-span-3 space-y-8">
|
||||
<header>
|
||||
<h1 className="text-3xl font-bold bg-gradient-to-r from-blue-400 to-cyan-300 bg-clip-text text-transparent mb-2">
|
||||
Welcome, {username}
|
||||
@@ -72,8 +72,8 @@ function UserDashboard({ token, username }) {
|
||||
<Car className="text-blue-400" /> My Registered Plates
|
||||
</h2>
|
||||
|
||||
<div className="space-y-4">
|
||||
{plates.length === 0 && <p className="text-slate-500">No plates registered.</p>}
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
{plates.length === 0 && <p className="text-slate-500 col-span-3">No plates registered.</p>}
|
||||
{plates.map(plate => (
|
||||
<div key={plate.id} className="flex items-center justify-between p-4 bg-slate-900 rounded-xl border border-slate-700">
|
||||
<div>
|
||||
@@ -126,32 +126,6 @@ function UserDashboard({ token, username }) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Right: Live Feed Preview */}
|
||||
<div className="space-y-6">
|
||||
<div className="bg-slate-800 rounded-2xl p-4 border border-slate-700">
|
||||
<h3 className="font-bold text-slate-400 mb-4 text-xs uppercase tracking-wider">Live Gate Feed</h3>
|
||||
<div className="aspect-video bg-black rounded-lg overflow-hidden relative">
|
||||
<img
|
||||
src="http://192.168.196.100:5001/video_feed"
|
||||
className="w-full h-full object-cover"
|
||||
onError={(e) => e.target.style.display = 'none'}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="bg-slate-800 rounded-2xl p-4 border border-slate-700">
|
||||
<h3 className="font-bold text-slate-400 mb-4 text-xs uppercase tracking-wider">Recent Activity</h3>
|
||||
<div className="space-y-3">
|
||||
{detections.map((d, i) => (
|
||||
<div key={i} className="flex items-center justify-between text-sm">
|
||||
<span className="font-mono font-bold text-slate-300">{d.plate}</span>
|
||||
<span className={`text-xs ${d.status === 'GRANTED' ? 'text-green-400' : 'text-red-400'}`}>{d.status}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user