omninexus-ai / components /Sidebar.tsx
aditya9708's picture
Auto-deploy from AI Studio
e4c7604 verified
Raw History Blame Contribute Delete
7.59 kB
import React from 'react';
import { AppView } from '../types';
interface SidebarProps {
currentView: AppView;
onNavigate: (view: AppView) => void;
isOpen: boolean;
setIsOpen: (open: boolean) => void;
credits: number;
isAdmin: boolean;
onToggleAdmin: () => void;
}
const Sidebar: React.FC<SidebarProps> = ({ currentView, onNavigate, isOpen, setIsOpen, credits }) => {
const navItems = [
{ view: AppView.EXPLORER, icon: 'M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z', label: 'Market' },
{ view: AppView.CREATE, icon: 'M12 4v16m8-8H4', label: 'Architect' },
{ view: AppView.DASHBOARD, icon: 'M13 7h8m0 0v8m0-8l-8 8-4-4-6 6', label: 'Vault (₹)' },
{ view: AppView.PRICING, icon: 'M12 11c0 3.517-1.009 6.799-2.753 9.571m-1.196-8.236A9.964 9.964 0 0012 15a9.964 9.964 0 004-4M9.458 11.892A9.06 9.06 0 018 15a9.06 9.06 0 01-1.458-3.108', label: 'Top-up' },
];
return (
<>
{isOpen && <div className="fixed inset-0 bg-black/90 z-40 lg:hidden backdrop-blur-xl" onClick={() => setIsOpen(false)} />}
<aside className={`fixed lg:static inset-y-0 left-0 w-64 bg-[#020617] border-r border-slate-900/50 z-50 transform ${isOpen ? 'translate-x-0' : '-translate-x-full'} lg:translate-x-0 transition-transform duration-500 ease-[cubic-bezier(0.23,1,0.32,1)] flex flex-col shadow-2xl`}>
<div className="p-8 pb-12 flex flex-col gap-1">
<div className="flex items-center gap-4 mb-2">
<div className="w-10 h-10 premium-gradient rounded-xl flex items-center justify-center shadow-2xl shadow-indigo-600/30">
<svg className="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={3} d="M13 10V3L4 14h7v7l9-11h-7z" /></svg>
</div>
<span className="text-2xl font-black tracking-tighter text-white">OMNI</span>
</div>
<span className="text-[8px] font-black text-slate-600 uppercase tracking-[0.4em] ml-1">Live Global Terminal</span>
</div>
<nav className="flex-1 px-4 space-y-1 overflow-y-auto no-scrollbar">
{navItems.map((item) => (
<button
key={item.view}
onClick={() => onNavigate(item.view)}
className={`w-full flex items-center gap-4 px-5 py-4 rounded-[20px] transition-all duration-300 group ${currentView === item.view ? 'bg-indigo-600/10 text-indigo-400 ring-1 ring-indigo-500/20' : 'text-slate-600 hover:text-white hover:bg-slate-900/50'}`}
>
<svg className={`w-5 h-5 transition-transform duration-300 ${currentView === item.view ? 'text-indigo-400 scale-110' : 'text-slate-700 group-hover:text-slate-400'}`} fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2.5} d={item.icon} /></svg>
<span className="font-black text-[10px] uppercase tracking-[0.2em]">{item.label}</span>
</button>
))}
<div className="mt-8 px-4 py-6 bg-indigo-500/5 border border-indigo-500/10 rounded-3xl space-y-2">
<p className="text-[8px] font-black text-indigo-400/60 uppercase tracking-widest mb-3 text-center">Help & Support</p>
<a
href="https://wa.me/918789912899"
target="_blank"
rel="noreferrer"
className="flex items-center justify-center gap-2 py-3 bg-emerald-600 hover:bg-emerald-500 text-white rounded-2xl text-[9px] font-black uppercase tracking-widest transition-all shadow-lg shadow-emerald-600/20"
>
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>
WhatsApp
</a>
<a
href="mailto:adityaverma9708@gmail.com"
className="flex items-center justify-center gap-2 py-3 bg-slate-900 border border-slate-800 hover:border-indigo-500/50 text-slate-300 hover:text-white rounded-2xl text-[9px] font-black uppercase tracking-widest transition-all"
>
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2.5} d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2-2v12a2 2 0 002 2z" /></svg>
Email Help
</a>
</div>
</nav>
<div className="p-6">
<div className="bg-[#0a0f1e] border border-slate-800/60 rounded-3xl p-6 mb-6 group cursor-pointer hover:border-indigo-500/30 transition-all shadow-xl" onClick={() => onNavigate(AppView.PRICING)}>
<div className="flex items-center justify-between mb-2">
<span className="text-[8px] font-black text-slate-600 uppercase tracking-widest">Fuel Level</span>
<span className="flex h-1.5 w-1.5 rounded-full bg-emerald-500"></span>
</div>
<div className="flex items-baseline gap-2 mb-4">
<span className="text-3xl font-black text-white">{credits}</span>
<span className="text-[8px] font-black text-slate-500 uppercase tracking-widest">CRD</span>
</div>
<button className="w-full py-3 rounded-xl bg-indigo-600 text-[9px] font-black uppercase tracking-widest text-white shadow-lg shadow-indigo-600/20">
Buy Fuel
</button>
</div>
<div className="flex items-center gap-3 px-1 border-t border-white/5 pt-6">
<div className="w-10 h-10 rounded-xl bg-indigo-600/20 border border-indigo-500/30 flex items-center justify-center text-[10px] font-black text-indigo-400 uppercase tracking-tighter">AV</div>
<div className="flex-1 min-w-0">
<p className="text-[10px] font-black text-white truncate uppercase tracking-tighter">Aditya Verma</p>
<p className="text-[7px] text-slate-500 font-bold truncate">adityaverma9708@gmail.com</p>
<p className="text-[6px] text-emerald-400 font-black uppercase tracking-[0.2em] mt-1">Verified Architect</p>
</div>
</div>
</div>
</aside>
</>
);
};
export default Sidebar;