import { useEffect } from "react"; import { isRouteErrorResponse, Link, Links, Meta, Outlet, Scripts, ScrollRestoration, } from "react-router"; import type { Route } from "./+types/root"; import "./app.css"; import { AuthProvider } from "~/lib/auth-context" import { DataProvider } from "~/lib/data-context"; import Nav from "~/components/Nav"; export const links: Route.LinksFunction = () => [ { rel: "preconnect", href: "https://fonts.googleapis.com" }, { rel: "preconnect", href: "https://fonts.gstatic.com", crossOrigin: "anonymous", }, { rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap", }, ]; export function Layout({ children }: { children: React.ReactNode }) { return ( {/* Runs before React hydrates to avoid flash of wrong theme */}