/** * Application Layout Component * Main layout wrapper that combines sidebar, header, breadcrumbs, and content area * Provides the standard application shell for authenticated pages */ 'use client'; import { ReactNode } from 'react'; import { cn } from '@/lib/utils'; import { Sidebar } from './Sidebar'; import { AppHeader } from './AppHeader'; import { AppBreadcrumbs, type BreadcrumbItem } from './AppBreadcrumbs'; interface Project { id: string; slug: string; name: string; } interface AppLayoutProps { /** Page content */ children: ReactNode; /** Current project (for project-specific pages) */ currentProject?: Project; /** List of available projects */ projects?: Project[]; /** Callback when project is changed */ onProjectChange?: (projectSlug: string) => void; /** Custom breadcrumb items (overrides auto-generation) */ breadcrumbs?: BreadcrumbItem[]; /** Hide breadcrumbs */ hideBreadcrumbs?: boolean; /** Hide sidebar */ hideSidebar?: boolean; /** Additional className for main content area */ className?: string; /** Additional className for the outer wrapper */ wrapperClassName?: string; } export function AppLayout({ children, currentProject, projects = [], onProjectChange, breadcrumbs, hideBreadcrumbs = false, hideSidebar = false, className, wrapperClassName, }: AppLayoutProps) { return (
{/* Header */} {/* Main content area with sidebar */}
{/* Sidebar */} {!hideSidebar && } {/* Content area */}
{/* Breadcrumbs */} {!hideBreadcrumbs && } {/* Main content */}
{children}
); } /** * Page Container Component * Standard container for page content with consistent padding and max-width */ interface PageContainerProps { /** Page content */ children: ReactNode; /** Maximum width constraint */ maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '4xl' | '6xl' | 'full'; /** Additional className */ className?: string; } const maxWidthClasses: Record = { sm: 'max-w-sm', md: 'max-w-md', lg: 'max-w-lg', xl: 'max-w-xl', '2xl': 'max-w-2xl', '4xl': 'max-w-4xl', '6xl': 'max-w-6xl', full: 'max-w-full', }; export function PageContainer({ children, maxWidth = '6xl', className }: PageContainerProps) { return (
{children}
); } /** * Page Header Component * Consistent header for page titles and actions */ interface PageHeaderProps { /** Page title */ title: string; /** Optional description */ description?: string; /** Action buttons or other content */ actions?: ReactNode; /** Additional className */ className?: string; } export function PageHeader({ title, description, actions, className }: PageHeaderProps) { return (

{title}

{description &&

{description}

}
{actions &&
{actions}
}
); }