Skip to content
544 linesCodeBlameRaw
1import { useEffect, useMemo, useRef, useState } from "react";
2import {
3 isRouteErrorResponse,
4 Link,
5 Links,
6 Meta,
7 Outlet,
8 Scripts,
9 ScrollRestoration,
10 type ShouldRevalidateFunctionArgs,
11 useLocation,
12 useMatches,
13 useRouteError,
14 useRouteLoaderData,
15} from "react-router";
16
17import { type User, awaitsConfirmation, hasAccessIn, sharedWorkspaces } from "@g1t/contracts";
18
19import type { Route } from "./+types/root";
20import appCss from "./app.css?url";
21import displayFont from "@g1t/theme/fonts/bricolage-grotesque-latin.woff2?url";
22import sansFont from "@g1t/theme/fonts/hanken-grotesk-latin.woff2?url";
23import { ButtonLink } from "./components/ui";
24import { Card } from "./components/ui/card";
25import { AppShell, Progress, type ShellData, useLeaving } from "./components/shell";
26import { SiteFooter } from "./components/footer";
27import { PublicHeader } from "./components/public-header";
28import { SpikeBanner } from "./components/spike-banner";
29import { PolicyNotice } from "./components/policy-notice";
30import { identify } from "./lib/analytics.client";
31import { visitorAsksFirst } from "./lib/analytics-consent";
32import { AnalyticsConsent } from "./components/analytics-consent";
33import { readCookie } from "./lib/mission";
34import { WORKSPACE_COOKIE, workspaceFor } from "./lib/workspace-choice";
35import { PageMain } from "./components/landmark";
36import { NotFound } from "./components/not-found";
37import { frameOf } from "./lib/chrome";
38import { DOCK_COOKIE, SIDEBAR_COOKIE, pinsToShow, sidebarClosed } from "./lib/apps";
39import { savedPins } from "./lib/dock.server";
40import { StandaloneFrame } from "./components/standalone";
41import { billing, chat, identity, inbox, projects } from "./lib/services.server";
42import { unreadTotals } from "./lib/chat";
43import { countsFor, readableRepos } from "./lib/access.server";
44import { shortCache } from "./lib/cache.server";
45import { getViewer, viewerMiddleware } from "./lib/session.server";
46import { shortcutOf, workspaceProjects } from "./lib/workspace-projects.server";
47import { registrationMode } from "./lib/registration.server";
48import { addresses } from "./lib/addresses.server";
49import { RELOADED_KEY, RELOAD_GIVE_UP_MS, clientNavigated, reloadFixes, reloadedBefore } from "./lib/stale-build";
50import { useNonce } from "./lib/nonce";
51import { useStuckNavigationRescue } from "./lib/stuck";
52import { isNeedsSignIn } from "./lib/website-token";
53import { offerTicket, setLiveViaToken } from "./lib/live-socket";
54import { socketTicketFor } from "./lib/socket-ticket.server";
55import { DesktopRunnerLink } from "./components/desktop-runner-link";
56import { LiveNotifications } from "./components/notifications/live-notifications";
57import { THEME_COLOR, THEME_COOKIE, readTheme, themeAttribute, useThemeChoice } from "./lib/theme";
58
59
60export const links: Route.LinksFunction = () => [
61 { rel: "icon", href: "/favicon.ico", sizes: "32x32" },
62 { rel: "icon", type: "image/svg+xml", href: "/favicon.svg" },
63 { rel: "icon", type: "image/png", sizes: "192x192", href: "/icon-192.png" },
64 { rel: "icon", type: "image/png", sizes: "512x512", href: "/icon-512.png" },
65 // Home screens and password managers look for a square, opaque 180px tile;
66 // the "-precomposed" name is served too, for the ones that ask for it.
67 { rel: "apple-touch-icon", sizes: "180x180", href: "/apple-touch-icon.png" },
68 // Installable: name, icons and colours for "Add to Home Screen" (public/site.webmanifest;
69 // manifest.webmanifest is the same file, kept for installs that already point at it).
70 { rel: "manifest", href: "/site.webmanifest" },
71 // The text and headline faces are wanted on every page, so they start
72 // loading with the stylesheet; mono waits until something uses it.
73 { rel: "preload", href: sansFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" },
74 { rel: "preload", href: displayFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" },
75];
76
77export const middleware: Route.MiddlewareFunction[] = [viewerMiddleware];
78
79export async function loader({ context, params, request }: Route.LoaderArgs) {
80 const user = getViewer(context);
81 const cookies = request.headers.get("cookie");
82 const chosen = readCookie(cookies, WORKSPACE_COOKIE);
83 const dock = readCookie(cookies, DOCK_COOKIE);
84 // Whether sign-up takes an invite: the sign-up page says so, and
85 // Settings → Invites offers invites to g1t only then. Cached per isolate.
86 const [shell, mode, sounds] = await Promise.all([
87 // An account still confirming its address sees only the pages that
88 // allows (lib/confirm-gate.ts), in the visitor's frame.
89 user && !awaitsConfirmation(user)
90 ? shellFor(user, params, chosen, context).catch((error: unknown) => {
91 // A sidebar that could not be read is no reason to lose the page,
92 // or to draw it as if they were signed out.
93 console.error("root: the sidebar could not be read", error);
94 return bareShell(user, params, chosen);
95 })
96 : visitorShell(params, context),
97 registrationMode(),
98 // Their chat sounds, with the page, so the first live event already
99 // respects them (lib/sounds.ts); the defaults when identity is slow.
100 user && !awaitsConfirmation(user) ? identity.soundSettings(user).catch(() => null) : Promise.resolve(null),
101 ]);
102 // The apps this person pinned to their rail here: as their account keeps
103 // them (read with the rest of the shell), else as this device's cookie
104 // remembers them (lib/apps.ts).
105 if (shell.workspace) shell.pins = pinsToShow(shell.pins, dock, shell.workspace.slug);
106 // Where this g1t lives, for clone lines, agent setup and link previews.
107 return {
108 user,
109 shell,
110 // For a page opened with an access token: the feed socket's ticket,
111 // minted here so the feed opens without asking for one (lib/live-socket.ts).
112 liveTicket: user?.token?.website ? await socketTicketFor(context, request, "/-/live") : null,
113 // Whether they folded the sidebar away, so the page is drawn that way from the start.
114 sidebarClosed: sidebarClosed(readCookie(cookies, SIDEBAR_COOKIE)),
115 // Their Appearance, so the page is drawn in it from the first byte (lib/theme.ts).
116 theme: readTheme(readCookie(cookies, THEME_COOKIE)),
117 // What they hear when chat moves (components/notifications/sounds.tsx).
118 sounds,
119 inviteOnly: mode !== "open",
120 addresses: addresses(),
121 // Visitors from where the law asks first are asked before analytics runs.
122 analyticsConsent: visitorAsksFirst(request),
123 };
124}
125
126/**
127 * The sidebar for someone not signed in: nothing of their own, only the
128 * open counts of the project being looked at. One call, and only in a
129 * project; it answers the same for a private project as a missing one.
130 */
131async function visitorShell(params: { owner?: string; repo?: string }, context: Route.LoaderArgs["context"]): Promise<ShellData> {
132 const path = params.owner && params.repo ? { namespace: params.owner, name: params.repo } : null;
133 const counts = path ? await countsFor(context, params) : null;
134 return {
135 workspace: null,
136 repos: [],
137 repo: path && counts?.ok ? { ...path, member: false, issues: counts.value.issues, pulls: counts.value.pulls } : null,
138 limit: null,
139 monthUsageMicros: null,
140 };
141}
142
143/** The sidebar from what the session already says, with no service asked. */
144function bareShell(user: User, params: { owner?: string; repo?: string }, chosen: string | null): ShellData {
145 return {
146 workspace: workspaceFor(user.workspaces ?? [], chosen, params),
147 repos: [],
148 repo: null,
149 limit: null,
150 monthUsageMicros: null,
151 };
152}
153
154/**
155 * The sidebar only changes with the workspace or repository being looked
156 * at, or after something was submitted: not on every page within them.
157 */
158export function shouldRevalidate({
159 currentParams,
160 nextParams,
161 formMethod,
162 defaultShouldRevalidate,
163}: ShouldRevalidateFunctionArgs) {
164 if (formMethod && formMethod !== "GET") return defaultShouldRevalidate;
165 return currentParams.owner !== nextParams.owner || currentParams.repo !== nextParams.repo;
166}
167
168/**
169 * The sidebar: the workspace whose pages or project these are when it is
170 * one of yours, else the one you chose (lib/workspace-choice.ts); its
171 * projects; and the repository being looked at.
172 */
173async function shellFor(
174 user: User,
175 params: { owner?: string; repo?: string },
176 chosen: string | null,
177 context: Route.LoaderArgs["context"],
178): Promise<ShellData> {
179 const memberships = user.workspaces ?? [];
180 const workspace = workspaceFor(memberships, chosen, params);
181 const path = params.owner && params.repo ? { namespace: params.owner, name: params.repo } : null;
182 const now = new Date();
183 const monthStart = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1)).toISOString();
184 // What the sidebar shows of the workspace changes rarely: kept for a few
185 // seconds per person and workspace, except just after they changed
186 // something (lib/cache.server.ts).
187 const kept = <T,>(what: string, load: () => Promise<T>) =>
188 workspace ? shortCache(`shell:${what}:${user.id}:${workspace.slug}`, SHELL_TTL_MS, load) : Promise.resolve(null);
189 const [listed, counts, status, usage, limit, entitlements, shared, unread, shortcuts, chatUnread, dockPins] = await Promise.all([
190 // Every project, for the palette and the count; the sidebar lists only
191 // the person's pinned and recent ones (lib/pins.ts).
192 workspace ? workspaceProjects(workspace.slug, user) : Promise.resolve(null),
193 path ? countsFor(context, params) : Promise.resolve(null),
194 // Whether billing is on, without reading the account: that asks the
195 // card processor about the workspace's cards, too slow for every page.
196 kept("status", () => billing.status()).catch(() => null),
197 kept(`usage:${monthStart}`, () => billing.usage(workspace!.slug, user, monthStart)).catch(() => null),
198 kept("limit", () => billing.limit(workspace!.slug, user)).catch(() => null),
199 kept("entitlements", () => billing.entitlements(workspace!.slug)).catch(() => null),
200 sharedRepos(user),
201 // The bell's count: one query, never kept, so marking an item shows at once.
202 inbox.counts(user.username).catch(() => null),
203 // Never kept: opening a project moves it up Recent.
204 workspace ? projects.shortcuts(workspace.slug, user).catch(() => null) : Promise.resolve(null),
205 // The rail's Chat badge: never kept, and never waited on for long.
206 workspace ? chatUnreadFor(workspace.slug, user) : Promise.resolve(null),
207 // The rail's pins, kept with the account so every device shows the same
208 // rail; never kept here, so a pin shows the moment it is made. Null
209 // falls back to the cookie (lib/dock.server.ts).
210 workspace ? savedPins(user, workspace.slug) : Promise.resolve(null),
211 ]);
212 return {
213 workspace,
214 // Projects are what the sidebar lists: what the workspace builds and runs.
215 repos: listed?.ok ? listed.value.map(shortcutOf) : [],
216 pinned: (shortcuts?.pinned ?? []).map(shortcutOf),
217 recent: (shortcuts?.recent ?? []).map(shortcutOf),
218 repo:
219 path && counts?.ok
220 ? {
221 ...path,
222 // Until the repository's own page says what their role is.
223 member: hasAccessIn(user, path.namespace),
224 issues: counts.value.issues,
225 pulls: counts.value.pulls,
226 }
227 : null,
228 // Where the workspace stands against its usage limit, once billing is on.
229 limit:
230 status?.enabled && limit?.ok
231 ? {
232 exposureMicros: limit.value.exposureMicros,
233 ceilingMicros: limit.value.ceilingMicros,
234 state: limit.value.state,
235 comped: limit.value.trust === "internal",
236 }
237 : null,
238 free: Boolean(status?.free),
239 // A spend spike or a hold pauses new compute: the shell says so on every page.
240 compute:
241 workspace && entitlements && (entitlements.paused || entitlements.spike?.status === "open")
242 ? { paused: entitlements.paused, spike: entitlements.spike ?? null, owner: workspace.role === "owner" }
243 : null,
244 shared,
245 inbox: unread,
246 chat: chatUnread,
247 pins: dockPins ?? undefined,
248 // While g1t is free every charge is zero, so usage is shown at cost.
249 // Usage at price, the one figure every page shows.
250 monthUsageMicros: usage?.ok ? (usage.value.free ? usage.value.usedMicros : (usage.value.priceMicros ?? usage.value.spentMicros)) : null,
251 };
252}
253
254/** Starred and recent conversations Home's sidebar lists. */
255const SHELL_CONVERSATIONS = 8;
256
257/**
258 * What is unread in chat, for the rail, and the starred and latest
259 * conversations, for Home's sidebar; null when chat is slow to answer or
260 * does not.
261 */
262async function chatUnreadFor(slug: string, user: User): Promise<ShellData["chat"]> {
263 const timeout = new Promise<null>((resolve) => setTimeout(() => resolve(null), CHAT_BADGE_WAIT_MS));
264 const read = chat
265 .sidebar(slug, user)
266 .then((result) => {
267 if (!result.ok) return null;
268 const entries = result.value.entries;
269 const latest = [...entries].sort((a, b) => (b.channel.last_message_at ?? "").localeCompare(a.channel.last_message_at ?? ""));
270 return {
271 ...unreadTotals(entries),
272 starred: entries.filter((e) => e.starred).slice(0, SHELL_CONVERSATIONS),
273 recent: latest.slice(0, SHELL_CONVERSATIONS),
274 };
275 })
276 .catch(() => null);
277 return Promise.race([read, timeout]);
278}
279
280/** The longest the rail's Chat badge holds up a page. */
281const CHAT_BADGE_WAIT_MS = 300;
282
283/**
284 * How long the sidebar's workspace answers are kept: as long as someone's
285 * own changes read fresh anyway (lib/perf.ts `PRIMARY_WINDOW_SECONDS`).
286 */
287const SHELL_TTL_MS = 30_000;
288
289/** Most repositories listed under Shared with you. */
290const MAX_SHARED = 20;
291
292/**
293 * Repositories shared with the user in workspaces they do not belong to,
294 * by their grants: only those, never the workspace's other repositories.
295 */
296async function sharedRepos(user: User): Promise<ShellData["shared"]> {
297 const outside = new Set(sharedWorkspaces(user));
298 if (outside.size === 0) return [];
299 const ids = (user.grants ?? []).filter((grant) => outside.has(grant.workspace)).map((grant) => grant.repo_id).slice(0, MAX_SHARED);
300 const found = await readableRepos(ids, user);
301 return found
302 .map((repo) => ({ namespace: repo.namespace, name: repo.name, isPrivate: repo.isPrivate }))
303 .sort((a, b) => `${a.namespace}/${a.name}`.localeCompare(`${b.namespace}/${b.name}`));
304}
305
306/**
307 * The root's data as the browser last had it. When a navigation fails in a
308 * way that takes the root's data with it, the error is still drawn in the
309 * person's own frame, signed in, not the visitor's. Never kept on the
310 * server, where one module serves everyone.
311 */
312let lastRoot: Awaited<ReturnType<typeof loader>> | undefined;
313
314export function Layout({ children }: { children: React.ReactNode }) {
315 const nonce = useNonce();
316 // Undefined when the root loader itself failed.
317 const loaded = useRouteLoaderData<typeof loader>("root");
318 const inBrowser = typeof document !== "undefined";
319 if (loaded && inBrowser) lastRoot = loaded;
320 const root = loaded ?? (inBrowser ? lastRoot : undefined);
321 const user = root?.user;
322 // A page opened with an access token signs its live sockets in with tickets (lib/live-socket.ts).
323 if (inBrowser) {
324 setLiveViaToken(Boolean(user?.token?.website));
325 offerTicket("/-/live", root?.liveTicket);
326 }
327 const { pathname } = useLocation();
328 // Drawn around the error page too: a 404 keeps the sidebar out of a
329 // project or workspace the viewer cannot see.
330 const error = useRouteError();
331 const missing = isRouteErrorResponse(error) && error.status === 404;
332 // The billing page shows the full banner itself.
333 const paused = root?.shell?.compute && root.shell.workspace && !pathname.endsWith("/-/billing") && (
334 <SpikeBanner
335 compact
336 slug={root.shell.workspace.slug}
337 entitlements={{ paused: root.shell.compute.paused, spike: root.shell.compute.spike }}
338 owner={root.shell.compute.owner}
339 />
340 );
341 // On the few pages an account still confirming its address can open
342 // besides /confirm-email (policies, support, signing in): the way back.
343 const verify = user && awaitsConfirmation(user) && pathname !== "/confirm-email" && (
344 <p
345 role="status"
346 className="flex flex-wrap items-center justify-center gap-x-3 gap-y-1 border-b border-warn/30 bg-warn/10 px-4 py-2 text-sm"
347 >
348 <span>Confirm your email address to start using g1t.</span>
349 <Link to="/confirm-email" className="font-medium underline underline-offset-4">
350 Enter your code
351 </Link>
352 </p>
353 );
354 // A workspace that requires two-factor authentication of someone who
355 // has not turned it on: they keep their place, and cannot use it yet.
356 const held = user?.held && user.held.length > 0 && pathname !== "/settings/two-factor" && <PolicyNotice held={user.held} />;
357 const leaving = useLeaving();
358 // Auto, Light or Dark: as the cookie said when the page was drawn, or as just switched.
359 const theme = useThemeChoice(root?.theme);
360 // Which frame the page is drawn in (lib/chrome.ts): on its own, the app's, or the public one.
361 const frame = frameOf(pathname, {
362 signedIn: user != null && !awaitsConfirmation(user),
363 workspace: (user?.workspaces ?? []).length > 0,
364 });
365 const banner =
366 paused || verify || held ? (
367 <>
368 {paused}
369 {verify}
370 {held}
371 </>
372 ) : null;
373 return (
374 <html lang="en" data-theme={themeAttribute(theme)}>
375 <head>
376 <meta charSet="utf-8" />
377 <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
378 {/* The browser bar matches the page: one colour for a chosen theme, the system's for Auto. */}
379 {theme === "auto" ? (
380 <>
381 <meta name="theme-color" media="(prefers-color-scheme: light)" content={THEME_COLOR.light} />
382 <meta name="theme-color" media="(prefers-color-scheme: dark)" content={THEME_COLOR.dark} />
383 </>
384 ) : (
385 <meta name="theme-color" content={THEME_COLOR[theme]} />
386 )}
387 <meta name="mobile-web-app-capable" content="yes" />
388 <meta name="apple-mobile-web-app-capable" content="yes" />
389 <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
390 {/* The stylesheet before everything React Router preloads, so a slow
391 connection paints sooner. */}
392 <link rel="stylesheet" href={appCss} precedence="default" />
393 {root?.analyticsConsent && <meta name="g1t-analytics" content="consent" />}
394 <Meta />
395 <Links nonce={nonce} />
396 </head>
397 <body className="flex min-h-screen flex-col" data-frame={frame === "app" && user && root?.shell ? "app" : frame}>
398 {/* The first stop for the keyboard: past the menus, to the page. */}
399 <a
400 href="#content"
401 className="sr-only rounded-md bg-fg px-3 py-2 text-sm font-medium text-bg focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-[70]"
402 >
403 Skip to content
404 </a>
405 {frame === "standalone" ? (
406 <StandaloneFrame>{children}</StandaloneFrame>
407 ) : frame === "app" && user && root?.shell ? (
408 <AppShell user={user} shell={root.shell} missing={missing} banner={banner} sidebarClosed={root.sidebarClosed}>
409 {children}
410 </AppShell>
411 ) : (
412 <>
413 <Progress />
414 <PublicHeader user={user} />
415 {banner}
416 <div id="content" tabIndex={-1} {...leaving} className={`grow outline-none ${leaving.className}`}>
417 {children}
418 </div>
419 <SiteFooter user={user} />
420 </>
421 )}
422 {/* Live notifications for the signed-in: the feed socket, toasts, the tab's count (components/notifications). */}
423 {user && !awaitsConfirmation(user) && (
424 <LiveNotifications
425 workspace={root?.shell?.workspace?.slug ?? null}
426 inbox={root?.shell?.inbox?.unread ?? null}
427 sounds={root?.sounds ?? null}
428 me={{ id: user.id, username: user.username }}
429 />
430 )}
431 {/* Inside the desktop app: who its runner runs for, and its registration (lib/desktop-runner.ts). */}
432 {(!user || !awaitsConfirmation(user)) && (
433 <DesktopRunnerLink
434 offer={{
435 signedIn: user != null,
436 workspaces: (user?.workspaces ?? []).filter((m) => m.role === "owner").map((m) => ({ slug: m.slug, name: m.name ?? null })),
437 current: root?.shell?.workspace?.slug ?? null,
438 }}
439 />
440 )}
441 <AnalyticsConsent />
442 <ScrollRestoration nonce={nonce} />
443 <Scripts nonce={nonce} />
444 </body>
445 </html>
446 );
447}
448
449export default function App() {
450 const userId = useRouteLoaderData<typeof loader>("root")?.user?.id ?? null;
451 // Tell analytics who is signed in, once per change; signing out forgets them.
452 const lastUserId = useRef<string | null>(null);
453 useEffect(() => {
454 identify(userId, lastUserId.current);
455 lastUserId.current = userId;
456 }, [userId]);
457 // A navigation that never arrives is loaded as a whole page (lib/stuck.ts).
458 useStuckNavigationRescue();
459 return <Outlet />;
460}
461
462export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
463 const location = useLocation();
464 const matches = useMatches();
465 const href = location.pathname + location.search + location.hash;
466 // A tab left open across a deploy: load the address again as a whole
467 // page, once, rather than show an error the reload fixes. A document load
468 // never reloads, so the server and the hydrating client render the same.
469 const reloadable = reloadFixes({
470 error,
471 status: isRouteErrorResponse(error) ? error.status : undefined,
472 clientNavigation: clientNavigated(location.key),
473 caughtByCatchAll: matches.at(-1)?.id === "routes/not-found",
474 });
475 // Already loaded again once, or the reload never started: show the page.
476 const tried = useMemo(() => reloadable && reloadedBefore(href), [reloadable, href]);
477 const [gaveUp, setGaveUp] = useState<string | null>(null);
478 const reload = reloadable && !tried && gaveUp !== href;
479 useEffect(() => {
480 if (!reload) return;
481 try {
482 sessionStorage.setItem(RELOADED_KEY, href);
483 } catch {
484 // No session storage: reload anyway; a document load never asks again.
485 }
486 window.location.assign(href);
487 const timer = window.setTimeout(() => setGaveUp(href), RELOAD_GIVE_UP_MS);
488 return () => window.clearTimeout(timer);
489 }, [reload, href]);
490 if (reload) {
491 return (
492 <PageMain className="mx-auto max-w-xl px-4 py-32 text-center text-sm text-muted" aria-busy="true">
493 <title>Loading · g1t</title>
494 Loading the latest version of g1t…
495 </PageMain>
496 );
497 }
498
499 let title = "Something went wrong";
500 let details = "An unexpected error occurred. Try again in a moment.";
501 let stack: string | undefined;
502
503 if (isRouteErrorResponse(error)) {
504 // The same page for something private and something missing.
505 if (error.status === 404) {
506 return (
507 <>
508 <title>Not found · g1t</title>
509 <NotFound data={error.data} />
510 </>
511 );
512 }
513 if (typeof error.data === "string" && error.data) {
514 details = error.data;
515 }
516 // A token asked for what needs a real sign-in (lib/website-token.ts).
517 if (isNeedsSignIn(error.data)) {
518 title = "This needs you to sign in";
519 details = error.data.message;
520 }
521 } else if (import.meta.env.DEV && error instanceof Error) {
522 details = error.message;
523 stack = error.stack;
524 }
525
526 return (
527 <PageMain className="mx-auto max-w-xl px-4 py-32 text-center">
528 <h1 className="text-2xl font-semibold tracking-tight">{title}</h1>
529 <p className="mt-3 text-muted">{details}</p>
530 <div className="mt-8">
531 <ButtonLink to="/" variant="outline">
532 Back to home
533 </ButtonLink>
534 </div>
535 {stack && (
536 <Card asChild tone="plain" radius="lg" className="mt-8 overflow-x-auto p-4 text-left text-xs">
537 <pre>
538 <code>{stack}</code>
539 </pre>
540 </Card>
541 )}
542 </PageMain>
543 );
544}