Advanced Admin Code
Advanced Admin Code
const themes = {
dark: {
name: "Oscuro",
background: "from-slate-900 via-purple-900 to-indigo-900",
primary: "from-indigo-500 to-purple-500",
accent: "from-purple-600 to-pink-600",
cards: "bg-white/90",
sidebar: "bg-gray-900/95",
textPrimary: "text-white",
emoji: "🌙"
},
light: {
name: "Claro",
background: "from-blue-50 via-indigo-50 to-purple-50",
primary: "from-blue-500 to-indigo-500",
accent: "from-blue-600 to-purple-600",
cards: "bg-white/95",
sidebar: "bg-white/95",
textPrimary: "text-gray-900",
emoji: "☀️"
},
neon: {
name: "Neón",
background: "from-black via-purple-900 to-black",
primary: "from-pink-500 to-cyan-500",
accent: "from-pink-600 to-cyan-600",
cards: "bg-gray-900/90",
sidebar: "bg-black/95",
textPrimary: "text-cyan-400",
emoji: "⚡"
},
nature: {
name: "Naturaleza",
background: "from-green-900 via-emerald-800 to-teal-900",
primary: "from-green-500 to-emerald-500",
accent: "from-green-600 to-emerald-600",
cards: "bg-white/90",
sidebar: "bg-green-900/95",
textPrimary: "text-white",
emoji: "🌿"
},
sunset: {
name: "Sunset",
background: "from-orange-900 via-red-800 to-pink-900",
primary: "from-orange-500 to-red-500",
accent: "from-red-600 to-pink-600",
cards: "bg-white/90",
sidebar: "bg-orange-900/95",
textPrimary: "text-white",
emoji: "🌅"
},
ocean: {
name: "Ocean",
background: "from-blue-900 via-teal-800 to-cyan-900",
primary: "from-blue-500 to-teal-500",
accent: "from-teal-600 to-cyan-600",
cards: "bg-white/90",
sidebar: "bg-blue-900/95",
textPrimary: "text-white",
emoji: "🌊"
}
}
const currentSong = {
title: "Bohemian Rhapsody",
artist: "Queen",
duration: "5:55",
currentTime: "2:34"
}
const stats = {
users: 24,
songs: 156,
revenue: 485,
votes: 89
}
const qrCodes = [
{ id: 1, name: "Mesa 1", scans: 45, location: "Entrada" },
{ id: 2, name: "Mesa 2", scans: 32, location: "Ventana" },
{ id: 3, name: "Mesa 3", scans: 28, location: "Terraza" },
{ id: 4, name: "Barra", scans: 67, location: "Bar Principal" }
]
const connectedUsers = [
{ id: 1, name: "María G.", joined: "14:30", votes: 8, status: "activo",
warnings: 0 },
{ id: 2, name: "Carlos M.", joined: "15:15", votes: 5, status: "activo",
warnings: 1 },
{ id: 3, name: "Ana L.", joined: "15:45", votes: 12, status: "activo",
warnings: 0 },
{ id: 4, name: "Luis R.", joined: "16:00", votes: 3, status: "inactivo",
warnings: 0 },
{ id: 5, name: "Pedro K.", joined: "16:30", votes: 2, status: "bloqueado",
warnings: 3 }
]
// Swap items
const temp = newQueue[currentIndex]
newQueue[currentIndex] = newQueue[newIndex]
newQueue[newIndex] = temp
setQueueList(newQueue)
}
<button
onClick={() => removeFromQueue(song.id)}
className="p-1 bg-red-500 text-white rounded hover:bg-
red-600"
title="Eliminar de la cola"
>
<X className="w-4 h-4" />
</button>
</div>
</div>
</div>
))}
</div>
</div>
</div>
)
case 'music':
return (
<div className="space-y-6">
<div className="flex items-center justify-between">
<h2 className="text-2xl font-bold text-white">Gestión Musical</h2>
<button className={`bg-gradient-to-r ${theme.primary} text-white px-4
py-2 rounded-xl shadow hover:shadow-md transition-all flex items-center space-x-
2`}>
<Plus className="w-4 h-4" />
<span>Nueva Playlist</span>
</button>
</div>
case 'qr':
return (
<div className="space-y-6">
<div className="flex items-center justify-between">
<h2 className="text-2xl font-bold text-white">Códigos QR</h2>
<button className={`bg-gradient-to-r ${theme.primary} text-white px-4
py-2 rounded-xl shadow hover:shadow-md transition-all flex items-center space-x-
2`}>
<Plus className="w-4 h-4" />
<span>Generar QR</span>
</button>
</div>
case 'users':
return (
<div className="space-y-6">
<div className="flex items-center justify-between">
<h2 className="text-2xl font-bold text-white">Usuarios
Conectados</h2>
<div className="flex space-x-2">
<span className="bg-green-500 text-white px-3 py-1 rounded-lg text-
sm">
{connectedUsers.filter(u => u.status === 'activo').length}
Activos
</span>
<span className="bg-red-500 text-white px-3 py-1 rounded-lg text-
sm">
{connectedUsers.filter(u => u.status === 'bloqueado').length}
Bloqueados
</span>
</div>
</div>
case 'settings':
return (
<div className="space-y-6">
<h2 className="text-2xl font-bold text-white">Configuración
Avanzada</h2>
default:
return <div>Sección en desarrollo...</div>
}
}
return (
<div className={`min-h-screen bg-gradient-to-br ${theme.background}`}>
{/* Theme Modal */}
{showThemeModal && (
<div className="fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-
center justify-center p-4">
<div className="bg-white rounded-2xl max-w-md w-full max-h-[80vh]
overflow-y-auto">
<div className="p-6">
<div className="flex items-center justify-between mb-6">
<h2 className="text-xl font-bold text-gray-900">Seleccionar
Tema</h2>
<button
onClick={() => setShowThemeModal(false)}
className="text-gray-500 hover:text-gray-700"
>
✕
</button>
</div>
<div className="flex">
{/* Sidebar */}
<div className={`w-64 ${theme.sidebar} backdrop-blur-xl shadow-xl border-r
border-white/10 min-h-screen`}>
<div className="p-6">
<div className="flex items-center space-x-3 mb-8">
<div className={`w-10 h-10 bg-gradient-to-br ${theme.primary}
rounded-xl flex items-center justify-center shadow-lg`}>
<Music className="w-5 h-5 text-white" />
</div>
<div>
<h1 className={`text-lg font-black ${theme.textPrimary}`}>Social
Juke</h1>
<p className={`text-xs ${theme.textPrimary} opacity-70`}>Admin
Panel</p>
</div>
</div>
<nav className="space-y-2">
{sidebarItems.map((item) => {
const Icon = item.icon
return (
<button
key={item.id}
onClick={() => setCurrentView(item.id)}
className={`w-full flex items-center space-x-3 px-4 py-3
rounded-xl font-medium transition-all ${
currentView === item.id
? `bg-gradient-to-r ${theme.primary} text-white shadow-lg`
: `${theme.textPrimary} hover:bg-white/10`
}`}
>
<Icon className="w-5 h-5" />
<span>{item.label}</span>
</button>
)
})}
</nav>
</div>
</div>