'use client' import * as React from 'react' import Link from 'next/link' import { usePathname } from 'next/navigation' import { Menu } from 'lucide-react' import { Button } from '@/components/ui/button' import { Sheet, SheetContent, SheetTrigger } from '@/components/ui/sheet' import { Separator } from '@/components/ui/separator' import { ModeToggle } from '@/components/mode-toggle' import { cn } from '@/lib/utils' interface NavItem { title: string href: string icon?: React.ComponentType<{ className?: string }> } interface AppShellProps { children: React.ReactNode navigation?: NavItem[] siteTitle?: string } export function AppShell({ children, navigation = [], siteTitle = 'App', }: AppShellProps) { const pathname = usePathname() const [open, setOpen] = React.useState(false) return (
{/* Header */}
{/* Mobile menu trigger */} {navigation.length > 0 && ( setOpen(false)} /> )} {/* Site title */} {siteTitle}
{/* Right side actions */}
{/* Desktop sidebar */} {navigation.length > 0 && ( )} {/* Main content */}
{children}
) } function MobileNav({ items, pathname, onItemClick, }: { items: NavItem[] pathname: string onItemClick: () => void }) { return ( ) } function DesktopNav({ items, pathname, }: { items: NavItem[] pathname: string }) { return ( <> {items.map((item) => { const Icon = item.icon const isActive = pathname === item.href return ( {Icon && } {item.title} ) })} ) }