|
| 1 | +/** |
| 2 | + * Copyright 2025 Google LLC |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +import { getCurrentUser } from "@/lib/firebase/serverApp"; |
| 18 | +import type { Metadata } from "next"; |
| 19 | +import { Geist, Geist_Mono } from "next/font/google"; |
| 20 | + |
| 21 | +import { Header } from "@/lib/components/header"; |
| 22 | +import { FirebaseUIProviderHoc } from "@/lib/firebase/ui"; |
| 23 | +import "./globals.css"; |
| 24 | + |
| 25 | +const geistSans = Geist({ |
| 26 | + variable: "--font-geist-sans", |
| 27 | + subsets: ["latin"], |
| 28 | +}); |
| 29 | + |
| 30 | +const geistMono = Geist_Mono({ |
| 31 | + variable: "--font-geist-mono", |
| 32 | + subsets: ["latin"], |
| 33 | +}); |
| 34 | + |
| 35 | +export const metadata: Metadata = { |
| 36 | + title: "Create Next App (SSR)", |
| 37 | + description: "Generated by create next app with SSR", |
| 38 | +}; |
| 39 | + |
| 40 | +export default async function RootLayout({ |
| 41 | + children, |
| 42 | +}: Readonly<{ |
| 43 | + children: React.ReactNode; |
| 44 | +}>) { |
| 45 | + const { currentUser } = await getCurrentUser(); |
| 46 | + |
| 47 | + return ( |
| 48 | + <html lang="en"> |
| 49 | + <body className={`${geistSans.variable} ${geistMono.variable} antialiased`}> |
| 50 | + <Header currentUser={currentUser} /> |
| 51 | + <FirebaseUIProviderHoc>{children}</FirebaseUIProviderHoc> |
| 52 | + </body> |
| 53 | + </html> |
| 54 | + ); |
| 55 | +} |
0 commit comments