2023-05-27 01:12:57 +03:00
|
|
|
import { createServerComponentSupabaseClient } from "@supabase/auth-helpers-nextjs";
|
2023-05-21 02:20:55 +03:00
|
|
|
import { Analytics } from "@vercel/analytics/react";
|
2023-05-27 01:12:57 +03:00
|
|
|
import { Inter } from "next/font/google";
|
|
|
|
import { cookies, headers } from "next/headers";
|
2023-05-18 14:37:03 +03:00
|
|
|
import NavBar from "./components/NavBar";
|
2023-05-27 01:12:57 +03:00
|
|
|
import { ToastProvider } from "./components/ui/Toast";
|
2023-05-18 14:37:03 +03:00
|
|
|
import "./globals.css";
|
2023-05-26 11:57:29 +03:00
|
|
|
import SupabaseProvider from "./supabase-provider";
|
2023-05-18 02:22:13 +03:00
|
|
|
|
2023-05-18 14:37:03 +03:00
|
|
|
const inter = Inter({ subsets: ["latin"] });
|
2023-05-18 02:22:13 +03:00
|
|
|
|
|
|
|
export const metadata = {
|
2023-05-18 14:37:03 +03:00
|
|
|
title: "Quivr - Get a Second Brain with Generative AI",
|
|
|
|
description:
|
|
|
|
"Quivr is your second brain in the cloud, designed to easily store and retrieve unstructured information.",
|
|
|
|
};
|
2023-05-18 02:22:13 +03:00
|
|
|
|
2023-05-26 11:57:29 +03:00
|
|
|
export default async function RootLayout({
|
|
|
|
children,
|
|
|
|
}: {
|
|
|
|
children: React.ReactNode;
|
|
|
|
}) {
|
2023-05-24 17:17:08 +03:00
|
|
|
const supabase = createServerComponentSupabaseClient({
|
|
|
|
headers,
|
|
|
|
cookies,
|
2023-05-26 11:57:29 +03:00
|
|
|
});
|
2023-05-24 17:17:08 +03:00
|
|
|
|
|
|
|
const {
|
|
|
|
data: { session },
|
2023-05-26 11:57:29 +03:00
|
|
|
} = await supabase.auth.getSession();
|
2023-05-24 17:17:08 +03:00
|
|
|
|
2023-05-18 02:22:13 +03:00
|
|
|
return (
|
|
|
|
<html lang="en">
|
2023-05-18 14:37:03 +03:00
|
|
|
<body
|
|
|
|
className={`bg-white text-black dark:bg-black dark:text-white min-h-screen w-full ${inter.className}`}
|
|
|
|
>
|
2023-05-26 11:57:29 +03:00
|
|
|
<ToastProvider>
|
2023-05-27 01:12:57 +03:00
|
|
|
<SupabaseProvider session={session}>
|
|
|
|
<NavBar />
|
|
|
|
{children}
|
|
|
|
</SupabaseProvider>
|
2023-05-26 11:57:29 +03:00
|
|
|
</ToastProvider>
|
2023-05-21 02:20:55 +03:00
|
|
|
<Analytics />
|
2023-05-18 14:37:03 +03:00
|
|
|
</body>
|
2023-05-18 02:22:13 +03:00
|
|
|
</html>
|
2023-05-26 11:57:29 +03:00
|
|
|
);
|
2023-05-18 02:22:13 +03:00
|
|
|
}
|