import type { ReactNode } from "react"; import * as Sentry from "@sentry/react-router"; import Script from "next/script"; import { Links, Meta, Outlet, Scripts } from "react-router"; import type { LinksFunction } from "react-router"; import { ThemeProvider, useTheme } from "next-themes"; // plane imports import { SITE_DESCRIPTION, SITE_NAME } from "@plane/constants"; import { cn } from "@plane/utils"; // types // assets import favicon16 from "@/app/assets/favicon/favicon-16x16.png?url"; import favicon32 from "@/app/assets/favicon/favicon-32x32.png?url"; import faviconIco from "@/app/assets/favicon/favicon.ico?url"; import icon180 from "@/app/assets/icons/icon-180x180.png?url"; import icon512 from "@/app/assets/icons/icon-512x512.png?url"; import ogImage from "@/app/assets/og-image.png?url"; import globalStyles from "@/styles/globals.css?url"; import type { Route } from "./+types/root"; // components import { LogoSpinner } from "@/components/common/logo-spinner"; // local import { CustomErrorComponent } from "./error"; import { AppProvider } from "./provider"; // fonts import "@fontsource-variable/inter"; import interVariableWoff2 from "@fontsource-variable/inter/files/inter-latin-wght-normal.woff2?url"; import "@fontsource/material-symbols-rounded"; import "@fontsource/ibm-plex-mono"; const APP_TITLE = "Plane | Simple, extensible, open-source project management tool."; export const links: LinksFunction = () => [ { rel: "icon", type: "image/png", sizes: "32x32", href: favicon32 }, { rel: "icon", type: "image/png", sizes: "16x16", href: favicon16 }, { rel: "shortcut icon", href: faviconIco }, { rel: "manifest", href: "/site.webmanifest.json" }, { rel: "apple-touch-icon", href: icon512 }, { rel: "apple-touch-icon", sizes: "180x180", href: icon180 }, { rel: "apple-touch-icon", sizes: "512x512", href: icon512 }, { rel: "manifest", href: "/manifest.json" }, { rel: "stylesheet", href: globalStyles }, { rel: "preload", href: interVariableWoff2, as: "font", type: "font/woff2", crossOrigin: "anonymous", }, ]; export function Layout({ children }: { children: ReactNode }) { const isSessionRecorderEnabled = parseInt(process.env.VITE_ENABLE_SESSION_RECORDER || "0"); return (
{/* Meta info for PWA */}