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-06-15 12:52:46 +03:00
|
|
|
|
|
|
|
import Footer from "@/lib/components/Footer";
|
|
|
|
import { NavBar } from "@/lib/components/NavBar";
|
|
|
|
import { ToastProvider } from "@/lib/components/ui/Toast";
|
|
|
|
import { BrainConfigProvider } from "@/lib/context/BrainConfigProvider/brain-config-provider";
|
|
|
|
|
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-06-15 12:52:46 +03:00
|
|
|
const RootLayout = async ({
|
2023-05-26 11:57:29 +03:00
|
|
|
children,
|
|
|
|
}: {
|
|
|
|
children: React.ReactNode;
|
2023-06-15 12:52:46 +03:00
|
|
|
}): Promise<JSX.Element> => {
|
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
|
2023-06-11 11:44:23 +03:00
|
|
|
className={`bg-white text-black min-h-screen flex flex-col dark:bg-black dark:text-white w-full ${inter.className}`}
|
2023-05-18 14:37:03 +03:00
|
|
|
>
|
2023-05-26 11:57:29 +03:00
|
|
|
<ToastProvider>
|
2023-05-27 01:12:57 +03:00
|
|
|
<SupabaseProvider session={session}>
|
2023-06-02 18:01:49 +03:00
|
|
|
<BrainConfigProvider>
|
|
|
|
<NavBar />
|
2023-06-11 11:44:23 +03:00
|
|
|
<div className="flex-1">{children}</div>
|
|
|
|
<Footer />
|
2023-06-02 18:01:49 +03:00
|
|
|
</BrainConfigProvider>
|
2023-05-27 01:12:57 +03:00
|
|
|
</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-06-15 12:52:46 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
export default RootLayout;
|