2023-05-27 01:12:57 +03:00
|
|
|
import { createServerComponentSupabaseClient } from "@supabase/auth-helpers-nextjs";
|
2023-09-18 16:12:50 +03:00
|
|
|
import { Analytics as VercelAnalytics } 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 { ToastProvider } from "@/lib/components/ui/Toast";
|
2023-09-05 12:43:03 +03:00
|
|
|
import { FeatureFlagsProvider } from "@/lib/context";
|
2023-07-05 10:30:22 +03:00
|
|
|
import { BrainProvider } from "@/lib/context/BrainProvider";
|
2023-06-20 17:17:13 +03:00
|
|
|
import { SupabaseProvider } from "@/lib/context/SupabaseProvider";
|
2023-07-07 13:56:08 +03:00
|
|
|
|
|
|
|
import { App } from "./App";
|
2023-09-22 19:15:28 +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-09-05 12:43:03 +03:00
|
|
|
<FeatureFlagsProvider>
|
|
|
|
<ToastProvider>
|
|
|
|
<SupabaseProvider session={session}>
|
2023-09-12 19:04:35 +03:00
|
|
|
<BrainProvider>
|
2023-10-11 19:36:16 +03:00
|
|
|
<App>{children}</App>
|
2023-09-12 19:04:35 +03:00
|
|
|
</BrainProvider>
|
2023-09-05 12:43:03 +03:00
|
|
|
</SupabaseProvider>
|
|
|
|
</ToastProvider>
|
2023-09-18 16:12:50 +03:00
|
|
|
<VercelAnalytics />
|
2023-09-05 12:43:03 +03:00
|
|
|
</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;
|