'use client'; import { AppFooter } from '@/components/layout/AppFooter'; import { AppHeader } from '@/components/layout/AppHeader'; import { AppSidebar } from '@/components/layout/AppSidebar'; import { useCurrentSession } from '@/hooks/auth/useCurrentSession'; import { routes } from '@/lib/routing/RouteConfig'; import { Layout } from '@/ui/Layout'; import { Container } from '@/ui/Container'; import { usePathname } from 'next/navigation'; import React from 'react'; export interface RootAppShellViewData { children: React.ReactNode; } /** * RootAppShellTemplate orchestrates the top-level semantic shells of the application. * It uses the canonical ui/Layout component to define the app frame. */ export function RootAppShellTemplate({ children }: RootAppShellViewData) { const pathname = usePathname(); const { data: session } = useCurrentSession(); const isAuthenticated = !!session; // Hide sidebar on landing page for unauthenticated users const isLandingPage = pathname === routes.public.home; const showSidebar = isAuthenticated && !isLandingPage; return ( } sidebar={showSidebar ? : undefined} footer={} fixedHeader fixedSidebar > {children} ); }