app_store / src /app /components /admin /AdminLayout.tsx
rajesh9698's picture
Deploy stable Nexsonium app to Hugging Face Space ๐Ÿš€
e354ac3 verified
Raw History Blame Contribute Delete
2.3 kB
import { useEffect } from 'react';
import { Outlet, useNavigate } from 'react-router';
import { HeroBackground } from '../3d/HeroBackground';
import { LogOut, LayoutDashboard, Home } from 'lucide-react';
export const AdminLayout = () => {
const navigate = useNavigate();
useEffect(() => {
const isAuthenticated = sessionStorage.getItem('adminAuth');
if (!isAuthenticated) {
navigate('/login');
}
}, [navigate]);
const handleLogout = () => {
sessionStorage.removeItem('adminAuth');
navigate('/login');
};
return (
<div className="min-h-screen bg-[#0A0A0F] text-white">
<HeroBackground />
<div className="relative z-10">
<div className="fixed top-0 left-0 right-0 z-50 backdrop-blur-md bg-[#0A0A0F]/90 border-b border-white/10">
<div className="max-w-7xl mx-auto px-4 py-4 flex items-center justify-between">
<div className="flex items-center gap-4">
<div className="w-10 h-10 bg-gradient-to-br from-[#7C3AED] to-[#06B6D4] rounded-xl flex items-center justify-center shadow-[0_0_20px_rgba(124,58,237,0.6)]">
<LayoutDashboard size={20} />
</div>
<h1 className="text-xl font-bold bg-gradient-to-r from-[#7C3AED] to-[#06B6D4] bg-clip-text text-transparent">
NEXSONIUM ADMIN
</h1>
</div>
<div className="flex items-center gap-3">
<button
onClick={() => window.location.href = 'http://localhost:5173/'}
className="px-4 py-2 bg-[#1A1A2E]/80 backdrop-blur-md rounded-xl border border-white/10 hover:bg-[#2A2A3E]/90 transition-all flex items-center gap-2"
>
<Home size={18} />
<span>Store</span>
</button>
<button
onClick={handleLogout}
className="px-4 py-2 bg-[#EF4444]/20 backdrop-blur-md rounded-xl border border-[#EF4444]/30 hover:bg-[#EF4444]/30 transition-all flex items-center gap-2"
>
<LogOut size={18} />
<span>Logout</span>
</button>
</div>
</div>
</div>
<div className="pt-20">
<Outlet />
</div>
</div>
</div>
);
};