import { ReactNode } from 'react'; import { useAuthStore } from '../../store/authStore'; import { useNavigate, useLocation } from 'react-router-dom'; import { LayoutDashboard, FolderOpen, LogOut, User, Settings, Menu, X, ChevronRight, Save, Cloud, Code2, Blocks, FileType } from 'lucide-react'; interface AppLayoutProps { children: ReactNode; sidebarContent?: ReactNode; showSidebar?: boolean; } export default function AppLayout({ children, sidebarContent, showSidebar }: AppLayoutProps) { const { user, logout } = useAuthStore(); const navigate = useNavigate(); const location = useLocation(); const isEditor = location.pathname.startsWith('/project/'); return (
{/* Top Navigation */}
{isEditor && ( <> {useAuthStore.getState().token ? 'Project Editor' : ''} )}
{user && ( <> {user.username}
{user.username.charAt(0).toUpperCase()}
)}
{/* Main Content Area */}
{/* Sidebar (for editor) */} {showSidebar && sidebarContent && ( )} {/* Main Content */}
{children}
); }