core/apps/webapp/app/root.tsx
Harshith Mullapudi d3f81404db Feat: first cut
2025-05-27 12:40:11 +05:30

67 lines
1.6 KiB
TypeScript

import {
Links,
Meta,
Outlet,
Scripts,
ScrollRestoration,
} from "@remix-run/react";
import type { LinksFunction } from "@remix-run/node";
import tailwindStylesheetUrl from "~/tailwind.css";
import { appEnvTitleTag } from "./utils";
export const links: 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&display=swap",
},
{ rel: "stylesheet", href: tailwindStylesheetUrl }
];
export const meta: MetaFunction = ({ data }) => {
const typedData = data as UseDataFunctionReturn<typeof loader>;
return [
{ title: `Echo${appEnvTitleTag(typedData.appEnv)}` },
{
name: "viewport",
content: "width=1024, initial-scale=1",
},
{
name: "robots",
content:
typeof window === "undefined" || window.location.hostname !== "cloud.trigger.dev"
? "noindex, nofollow"
: "index, follow",
},
];
};
export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<Meta />
<Links />
</head>
<body>
{children}
<ScrollRestoration />
<Scripts />
</body>
</html>
);
}
export default function App() {
return <Outlet />;
}