mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
38 lines
935 B
TypeScript
38 lines
935 B
TypeScript
import type { LoaderFunctionArgs } from "@remix-run/node";
|
|
import { Links, Meta, Outlet, Scripts, ScrollRestoration } from "@remix-run/react";
|
|
import { Api } from "bknd";
|
|
import { ClientProvider } from "bknd/ui";
|
|
|
|
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 const loader = async (args: LoaderFunctionArgs) => {
|
|
args.context.api = new Api({
|
|
host: new URL(args.request.url).origin
|
|
});
|
|
return null;
|
|
};
|
|
|
|
export default function App() {
|
|
return (
|
|
<ClientProvider>
|
|
<Outlet />
|
|
</ClientProvider>
|
|
);
|
|
}
|