2026-07-05 06:58:48 +02:00
|
|
|
import { Outlet } from 'react-router-dom'
|
2026-07-05 06:41:23 +02:00
|
|
|
import { useSession } from '../context/SessionContext.jsx'
|
|
|
|
|
import { useCapabilities } from '../hooks/useCapabilities.js'
|
|
|
|
|
import { LoadingState } from '../components/LoadingState.jsx'
|
2026-07-05 06:58:48 +02:00
|
|
|
import { DesktopSidebar } from '../components/DesktopSidebar.jsx'
|
|
|
|
|
import { BottomNav } from '../components/BottomNav.jsx'
|
|
|
|
|
import { ContextIndicator } from '../components/ContextIndicator.jsx'
|
2026-07-08 12:55:37 +02:00
|
|
|
import { ProgramScopeBar } from '../components/ProgramScopeBar.jsx'
|
|
|
|
|
import { QuickJump } from '../components/QuickJump.jsx'
|
|
|
|
|
import { RecentlyOpened } from '../components/RecentlyOpened.jsx'
|
2026-07-05 06:41:23 +02:00
|
|
|
|
|
|
|
|
export function AppLayout() {
|
2026-07-05 06:58:48 +02:00
|
|
|
const { me, signOut, loading } = useSession()
|
2026-07-05 06:41:23 +02:00
|
|
|
const { capabilities } = useCapabilities()
|
|
|
|
|
|
|
|
|
|
if (loading) {
|
|
|
|
|
return (
|
2026-07-05 06:58:48 +02:00
|
|
|
<div className="app-shell">
|
|
|
|
|
<main className="app-main">
|
|
|
|
|
<div className="app-page">
|
|
|
|
|
<LoadingState message="Session wird geladen …" />
|
|
|
|
|
</div>
|
|
|
|
|
</main>
|
|
|
|
|
</div>
|
2026-07-05 06:41:23 +02:00
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
2026-07-05 06:58:48 +02:00
|
|
|
<div className="app-shell">
|
|
|
|
|
<DesktopSidebar
|
|
|
|
|
capabilities={capabilities}
|
|
|
|
|
user={me}
|
|
|
|
|
onLogout={signOut}
|
|
|
|
|
/>
|
|
|
|
|
<div className="app-shell__column">
|
|
|
|
|
<header className="app-header app-header--mobile">
|
|
|
|
|
<div className="app-header__top">
|
|
|
|
|
<div className="app-brand">
|
|
|
|
|
<span className="app-brand__name">Kairo</span>
|
|
|
|
|
<span className="app-brand__family">Jinkendo Program Director</span>
|
|
|
|
|
</div>
|
2026-07-08 12:55:37 +02:00
|
|
|
<QuickJump />
|
2026-07-05 06:58:48 +02:00
|
|
|
</div>
|
|
|
|
|
<ContextIndicator variant="mobile" />
|
2026-07-08 12:55:37 +02:00
|
|
|
<ProgramScopeBar />
|
|
|
|
|
<RecentlyOpened />
|
2026-07-05 06:58:48 +02:00
|
|
|
</header>
|
2026-07-08 12:55:37 +02:00
|
|
|
<div className="app-chrome app-chrome--desktop">
|
|
|
|
|
<ProgramScopeBar />
|
|
|
|
|
<QuickJump />
|
|
|
|
|
<RecentlyOpened />
|
|
|
|
|
</div>
|
2026-07-05 06:58:48 +02:00
|
|
|
<main className="app-main">
|
|
|
|
|
<Outlet />
|
|
|
|
|
</main>
|
|
|
|
|
<BottomNav capabilities={capabilities} />
|
|
|
|
|
</div>
|
2026-07-05 06:41:23 +02:00
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|