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";
|
2023-06-26 12:36:15 +03:00
|
|
|
import { TrackingWrapper } from "@/lib/components/TrackingWrapper";
|
2023-06-15 12:52:46 +03:00
|
|
|
import { ToastProvider } from "@/lib/components/ui/Toast";
|
2023-06-20 17:17:13 +03:00
|
|
|
import { BrainProvider, FeatureFlagsProvider } from "@/lib/context";
|
2023-06-15 12:52:46 +03:00
|
|
|
import { BrainConfigProvider } from "@/lib/context/BrainConfigProvider/brain-config-provider";
|
2023-06-20 17:17:13 +03:00
|
|
|
import { SupabaseProvider } from "@/lib/context/SupabaseProvider";
|
2023-05-18 14:37:03 +03:00
|
|
|
import "./globals.css";
|
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-06-20 17:17:13 +03:00
|
|
|
<FeatureFlagsProvider>
|
2023-06-26 12:36:15 +03:00
|
|
|
<ToastProvider>
|
|
|
|
<SupabaseProvider session={session}>
|
|
|
|
<BrainConfigProvider>
|
|
|
|
<BrainProvider>
|
|
|
|
<TrackingWrapper />
|
|
|
|
<NavBar />
|
|
|
|
<div className="flex-1">{children}</div>
|
|
|
|
<Footer />
|
|
|
|
</BrainProvider>
|
|
|
|
</BrainConfigProvider>
|
|
|
|
</SupabaseProvider>
|
|
|
|
</ToastProvider>
|
2023-06-20 17:17:13 +03:00
|
|
|
<Analytics />
|
|
|
|
</FeatureFlagsProvider>
|
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;
|