import { Outlet, Link, useLocation, useNavigate } from 'react-router-dom' import { motion } from 'framer-motion' import { useState } from 'react' import { useAuthStore } from '../../store/authStore' import { HomeIcon, RectangleStackIcon, CurrencyDollarIcon, CodeBracketIcon, Cog6ToothIcon, Bars3Icon, XMarkIcon, ArrowRightOnRectangleIcon, PlusIcon, SparklesIcon, } from '@heroicons/react/24/outline' const navigation = [ { name: 'Overview', href: '/dashboard', icon: HomeIcon }, { name: 'Paywalls', href: '/dashboard/paywalls', icon: RectangleStackIcon }, { name: 'Sales', href: '/dashboard/sales', icon: CurrencyDollarIcon }, { name: 'Embeds', href: '/dashboard/embeds', icon: CodeBracketIcon }, { name: 'Settings', href: '/dashboard/settings', icon: Cog6ToothIcon }, ] export default function DashboardLayout() { const location = useLocation() const navigate = useNavigate() const { user, logout } = useAuthStore() const [sidebarOpen, setSidebarOpen] = useState(false) const handleLogout = async () => { await logout() navigate('/login') } const isActive = (href) => { if (href === '/dashboard') { return location.pathname === '/dashboard' } return location.pathname.startsWith(href) } return (
{/* Mobile sidebar overlay */} {sidebarOpen && (
setSidebarOpen(false)} /> )} {/* Sidebar */} {/* Main content */}
{/* Top bar */}
Create Paywall
{/* Page content */}
) }