import { useState } from 'react'; import { useRouter } from 'next/router'; import Link from 'next/link'; import { useTheme } from '../lib/theme-context'; export default function Layout({ children, user = { email: 'me@randallstillwell.com', role: 'user' } }) { const router = useRouter(); const { theme, toggleTheme } = useTheme(); const [searchQuery, setSearchQuery] = useState(''); const navigation = [ { name: 'Dashboard', href: '/dashboard', icon: 'grid', active: router.pathname === '/dashboard' }, { name: 'My Collection', href: '/collections', icon: 'collection', active: router.pathname === '/collections', badge: '247' }, { name: 'Cards', href: '/cards', icon: 'card', active: router.pathname === '/cards' }, { name: 'Decks', href: '/decks', icon: 'deck', active: router.pathname === '/decks', badge: '12' }, { name: 'Analytics', href: '/analytics', icon: 'analytics', active: router.pathname === '/analytics' }, { name: 'Community', href: '/community', icon: 'community', active: router.pathname === '/community' }, { name: 'Settings', href: '/settings', icon: 'settings', active: router.pathname === '/settings' }, ...(user?.role === 'admin' ? [ { name: 'Admin Tools', href: '/admin/card-editor', icon: 'admin', active: router.pathname.startsWith('/admin'), badge: 'ADMIN' } ] : []), { name: 'Logout', href: '/logout', icon: 'logout', active: router.pathname === '/logout' } ]; const getIcon = (iconName) => { const icons = { grid: ( ), collection: ( ), card: ( ), deck: ( ), analytics: ( ), community: ( ), settings: ( ), logout: ( ), admin: ( ) }; return icons[iconName] || icons.grid; }; return (
{user?.email || 'Guest'}
{user?.role || 'visitor'}