Bug fix: Dubbele sidebar verwijderd in patient detail routes. ClientSidebar was een duplicate van EPDSidebar's Level 2 navigatie. EPDSidebar is al context-aware en switcht automatisch tussen Level 1 (behandelaar context) en Level 2 (patient context) navigatie. Changes: - Removed: ClientSidebar component (117 lines duplicate code) - Removed: EPDLayoutClient wrapper (conditional sidebar hiding) - Simplified: Patient detail layout uses only PatientLayoutClient - Restored: EPD layout to direct EPDSidebar rendering Result: Single sidebar component, -117 lines code, DRY principle restored 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
/**
|
|
* EPD Application Layout
|
|
*
|
|
* Layout for the EPD application with sidebar navigation and header.
|
|
* Requires authentication via middleware.
|
|
*/
|
|
|
|
import type { ReactNode } from 'react';
|
|
import { EPDSidebar } from './components/epd-sidebar';
|
|
import { EPDHeader } from './components/epd-header';
|
|
import { getUser } from '@/lib/auth/server';
|
|
|
|
interface EPDLayoutProps {
|
|
children: ReactNode;
|
|
}
|
|
|
|
export default async function EPDLayout({ children }: EPDLayoutProps) {
|
|
// Get authenticated user
|
|
const user = await getUser();
|
|
|
|
return (
|
|
<div className="min-h-screen bg-slate-50 flex">
|
|
{/* Sidebar - Context-aware (switches between Level 1 and Level 2) */}
|
|
<EPDSidebar
|
|
userEmail={user?.email}
|
|
userName={user?.user_metadata?.full_name}
|
|
/>
|
|
|
|
{/* Main Content Area */}
|
|
<div className="flex-1 flex flex-col min-w-0">
|
|
{/* Header - Fixed 60px height */}
|
|
<EPDHeader />
|
|
|
|
{/* Page Content - Scrollable */}
|
|
<main className="flex-1 overflow-auto bg-white">
|
|
{children}
|
|
</main>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|