2024-09-27 19:48:49 -04:00
|
|
|
import type { Metadata } from "next";
|
|
|
|
import "./globals.css";
|
2025-01-04 20:22:01 -05:00
|
|
|
import { Figtree, Inter } from "next/font/google";
|
2024-10-14 12:10:02 -04:00
|
|
|
import { Toaster } from "@/components/ui/toaster";
|
2024-10-14 18:26:07 -04:00
|
|
|
import { ThemeProvider } from "@app/providers/ThemeProvider";
|
2024-12-12 22:46:58 -05:00
|
|
|
import EnvProvider from "@app/providers/EnvProvider";
|
2024-12-24 12:06:13 -05:00
|
|
|
import { Separator } from "@app/components/ui/separator";
|
2025-01-04 20:22:01 -05:00
|
|
|
import { pullEnv } from "@app/lib/pullEnv";
|
2025-03-16 15:20:19 -04:00
|
|
|
import { BookOpenText, ExternalLink } from "lucide-react";
|
2025-01-09 23:21:57 -05:00
|
|
|
import Image from "next/image";
|
2025-03-20 22:16:02 -04:00
|
|
|
import SupportStatusProvider from "@app/providers/SupporterStatusProvider";
|
|
|
|
import { createApiClient, internal, priv } from "@app/lib/api";
|
|
|
|
import { AxiosResponse } from "axios";
|
|
|
|
import { IsSupporterKeyVisibleResponse } from "@server/routers/supporterKey";
|
2025-04-07 14:38:49 -07:00
|
|
|
import SupporterMessage from "./components/SupporterMessage";
|
2024-09-27 19:48:49 -04:00
|
|
|
|
|
|
|
export const metadata: Metadata = {
|
2024-10-26 17:24:31 -04:00
|
|
|
title: `Dashboard - Pangolin`,
|
2024-12-12 22:46:58 -05:00
|
|
|
description: ""
|
2024-09-27 19:48:49 -04:00
|
|
|
};
|
|
|
|
|
2025-04-07 13:32:07 -07:00
|
|
|
export const dynamic = "force-dynamic";
|
2025-03-20 22:52:29 -04:00
|
|
|
|
2025-01-04 20:22:01 -05:00
|
|
|
// const font = Figtree({ subsets: ["latin"] });
|
|
|
|
const font = Inter({ subsets: ["latin"] });
|
2024-10-06 11:13:50 -04:00
|
|
|
|
2024-10-06 18:08:26 -04:00
|
|
|
export default async function RootLayout({
|
2024-12-12 22:46:58 -05:00
|
|
|
children
|
2024-09-27 19:48:49 -04:00
|
|
|
}: Readonly<{
|
2024-09-27 21:39:03 -04:00
|
|
|
children: React.ReactNode;
|
2024-09-27 19:48:49 -04:00
|
|
|
}>) {
|
2025-01-04 20:22:01 -05:00
|
|
|
const env = pullEnv();
|
|
|
|
|
2025-03-20 22:16:02 -04:00
|
|
|
let supporterData = {
|
|
|
|
visible: true
|
2025-03-21 18:36:11 -04:00
|
|
|
} as any;
|
2025-03-20 22:16:02 -04:00
|
|
|
|
2025-04-07 13:32:07 -07:00
|
|
|
const res = await priv.get<AxiosResponse<IsSupporterKeyVisibleResponse>>(
|
|
|
|
"supporter-key/visible"
|
|
|
|
);
|
2025-03-20 22:16:02 -04:00
|
|
|
supporterData.visible = res.data.data.visible;
|
2025-03-21 18:36:11 -04:00
|
|
|
supporterData.tier = res.data.data.tier;
|
2025-03-20 22:16:02 -04:00
|
|
|
|
2024-09-27 21:39:03 -04:00
|
|
|
return (
|
2024-10-14 18:26:07 -04:00
|
|
|
<html suppressHydrationWarning>
|
2025-01-03 22:32:24 -05:00
|
|
|
<body className={`${font.className} min-h-screen flex flex-col`}>
|
2024-10-14 18:26:07 -04:00
|
|
|
<ThemeProvider
|
|
|
|
attribute="class"
|
|
|
|
defaultTheme="system"
|
|
|
|
enableSystem
|
|
|
|
disableTransitionOnChange
|
|
|
|
>
|
2025-01-04 20:22:01 -05:00
|
|
|
<EnvProvider env={pullEnv()}>
|
2025-03-20 22:16:02 -04:00
|
|
|
<SupportStatusProvider supporterStatus={supporterData}>
|
|
|
|
{/* Main content */}
|
2025-04-12 15:04:32 -04:00
|
|
|
<div className="flex flex-col min-h-screen">
|
|
|
|
<div className="flex-1">
|
|
|
|
{children}
|
2025-03-20 22:16:02 -04:00
|
|
|
</div>
|
2025-04-12 15:04:32 -04:00
|
|
|
</div>
|
2025-03-20 22:16:02 -04:00
|
|
|
</SupportStatusProvider>
|
2024-12-12 22:46:58 -05:00
|
|
|
</EnvProvider>
|
2024-10-14 18:26:07 -04:00
|
|
|
<Toaster />
|
|
|
|
</ThemeProvider>
|
2024-10-06 11:13:50 -04:00
|
|
|
</body>
|
2024-09-27 21:39:03 -04:00
|
|
|
</html>
|
|
|
|
);
|
2024-09-27 19:48:49 -04:00
|
|
|
}
|