layout.tsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import type { Metadata } from "next";
  2. import { Inter } from "next/font/google";
  3. import "./globals.css";
  4. import { ThemeProvider } from "@/components/layout";
  5. import { AuthProvider } from "@/lib/auth-context";
  6. import { ModelSelectionProvider } from "@/contexts/model-selection-context";
  7. import { ErrorBoundary } from "@/components/ui/error-boundary";
  8. import "@/lib/error-handlers";
  9. import "@/lib/memory-utils";
  10. const inter = Inter({
  11. subsets: ["latin"],
  12. variable: "--font-sans",
  13. });
  14. export const metadata: Metadata = {
  15. title: "Stable Diffusion REST - Web UI",
  16. description: "Modern web interface for Stable Diffusion image generation",
  17. };
  18. export default function RootLayout({
  19. children,
  20. }: Readonly<{
  21. children: React.ReactNode;
  22. }>) {
  23. return (
  24. <html lang="en" suppressHydrationWarning>
  25. <head>
  26. {/* Load server configuration - this is dynamically generated by the server */}
  27. {/* Load synchronously to ensure config is available before React hydration */}
  28. <script src="/ui/config.js" async></script>
  29. </head>
  30. <body className={`${inter.variable} font-sans antialiased`}>
  31. <ThemeProvider
  32. attribute="class"
  33. defaultTheme="system"
  34. enableSystem
  35. disableTransitionOnChange
  36. >
  37. <ErrorBoundary>
  38. <AuthProvider>
  39. <ModelSelectionProvider>
  40. {children}
  41. </ModelSelectionProvider>
  42. </AuthProvider>
  43. </ErrorBoundary>
  44. </ThemeProvider>
  45. </body>
  46. </html>
  47. );
  48. }