import React, { type ReactNode } from 'react'; import { useAuth } from './AdminAuth'; const navItems = [ { href: '/admin', label: 'Dashboard', icon: '๐' }, { href: '/admin/revenue', label: 'Revenue', icon: '๐ฐ' }, { href: '/admin/performance', label: 'Performance', icon: '๐ฅ' }, { href: '/admin/homepage', label: 'Homepage', icon: '๐ ' }, { href: '/admin/feeds', label: 'Feeds', icon: '๐ก' }, { href: '/admin/feeds/health', label: 'Feed Health', icon: '๐ฉบ' }, { href: '/admin/data-quality', label: 'Data Quality', icon: '๐งน' }, { href: '/admin/products', label: 'Products', icon: '๐ฆ' }, { href: '/admin/collections', label: 'Collections', icon: '๐' }, { href: '/admin/analytics', label: 'Analytics', icon: '๐' }, { href: '/admin/emails', label: 'Email', icon: '๐ง' }, { href: '/admin/emails/editor', label: 'Email Editor', icon: 'โ๏ธ' }, { href: '/admin/subscribers', label: 'Subscribers', icon: '๐ฅ' }, { href: '/admin/crons', label: 'Crons', icon: 'โฐ' }, ]; function NavLink({ href, label, icon }: { href: string; label: string; icon: string }) { const active = typeof window !== 'undefined' && (window.location.pathname === href || (href !== '/admin' && window.location.pathname.startsWith(href))); return ( {icon} {label} ); } export default function AdminLayout({ children, title }: { children: ReactNode; title: string }) { const { user, logout } = useAuth(); return (