-
Notifications
You must be signed in to change notification settings - Fork 264
Expand file tree
/
Copy pathlayout.tsx
More file actions
68 lines (66 loc) · 2.76 KB
/
layout.tsx
File metadata and controls
68 lines (66 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import type { Metadata } from "next";
import "./globals.css";
import { ThemeProvider } from "next-themes";
import { QueryClientProvider } from "./queryClientProvider";
import { PostHogProvider } from "./posthogProvider";
import { Toaster } from "@/components/ui/toaster";
import { TooltipProvider } from "@/components/ui/tooltip";
import { SessionProvider } from "next-auth/react";
import { env, SOURCEBOT_VERSION } from "@sourcebot/shared";
import { PlanProvider } from "@/features/entitlements/planProvider";
import { getEntitlements } from "@sourcebot/shared";
export const metadata: Metadata = {
metadataBase: new URL(env.AUTH_URL),
// Using the title.template will allow child pages to set the title
// while keeping a consistent suffix.
title: {
default: "Sourcebot",
template: "%s | Sourcebot",
},
description:
"Sourcebot is a self-hosted code understanding tool. Ask questions about your codebase and get rich Markdown answers with inline citations.",
manifest: "/manifest.json",
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html
lang="en"
// @see : https://github.com/pacocoursey/next-themes?tab=readme-ov-file#with-app
suppressHydrationWarning
>
<body>
<Toaster />
<SessionProvider>
<PlanProvider entitlements={getEntitlements()}>
<PostHogProvider
isDisabled={env.SOURCEBOT_TELEMETRY_DISABLED === 'true'}
isPiiEnabled={env.SOURCEBOT_TELEMETRY_PII_COLLECTION_ENABLED === 'true'}
// @note: the posthog api key doesn't need to be kept secret,
// so we are safe to send it to the client.
posthogApiKey={env.POSTHOG_PAPIK}
sourcebotVersion={SOURCEBOT_VERSION}
sourcebotInstallId={env.SOURCEBOT_INSTALL_ID}
>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
<QueryClientProvider>
<TooltipProvider>
{children}
</TooltipProvider>
</QueryClientProvider>
</ThemeProvider>
</PostHogProvider>
</PlanProvider>
</SessionProvider>
</body>
</html>
);
}