forked from awsl-project/maxx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp-layout.tsx
More file actions
38 lines (34 loc) · 1.38 KB
/
app-layout.tsx
File metadata and controls
38 lines (34 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { Outlet } from 'react-router-dom';
import { AppSidebar } from './app-sidebar';
import { SidebarProvider, SidebarInset, SidebarTrigger } from '@/components/ui/sidebar';
import { ForceProjectDialog } from '@/components/force-project-dialog';
import { usePendingSession } from '@/hooks/use-pending-session';
import { useSettings } from '@/hooks/queries';
export function AppLayout() {
const { pendingSession, clearPendingSession } = usePendingSession();
const { data: settings } = useSettings();
const forceProjectEnabled = settings?.force_project_binding === 'true';
const timeoutSeconds = parseInt(settings?.force_project_timeout || '30', 10);
return (
<SidebarProvider className="h-svh! min-h-0! overflow-hidden">
<AppSidebar />
<SidebarInset className="flex flex-col">
{/* Mobile header with sidebar trigger */}
<header className="flex h-12 shrink-0 items-center gap-2 border-b px-4 md:hidden">
<SidebarTrigger />
</header>
<div className="@container/main flex-1 min-h-0 overflow-hidden">
<Outlet />
</div>
</SidebarInset>
{/* Force Project Dialog - only show when enabled */}
{forceProjectEnabled && (
<ForceProjectDialog
event={pendingSession}
onClose={clearPendingSession}
timeoutSeconds={timeoutSeconds}
/>
)}
</SidebarProvider>
);
}