layout.jsx 590 B

12345678910111213141516171819202122
  1. import AppShell from "@/components/app-shell/AppShell";
  2. import AuthProvider from "@/components/auth/AuthProvider";
  3. import AuthGate from "@/components/auth/AuthGate";
  4. /**
  5. * Protected layout
  6. *
  7. * UX goal:
  8. * - Keep the AppShell visible at all times (TopNav + Sidebar).
  9. * - Render auth/loading/error states inside the main content area via AuthGate.
  10. *
  11. * This avoids "blank spinner" screens on slow connections.
  12. */
  13. export default function ProtectedLayout({ children }) {
  14. return (
  15. <AuthProvider>
  16. <AppShell>
  17. <AuthGate>{children}</AuthGate>
  18. </AppShell>
  19. </AuthProvider>
  20. );
  21. }