g1t/apps/web/app/routes/repo/blob.tsx

20 lines693 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Initial g1t: services, event bus, intents and attempts1import { env } from "cloudflare:workers";
2
3import type { Route } from "./+types/blob";
4import { BlobView } from "../../components/repo-view";
5import { getViewer, unwrap } from "../../lib/session.server";
6
7export function meta({ params }: Route.MetaArgs) {
8 return [{ title: `${params["*"]} · ${params.owner}/${params.repo} · g1t` }];
9}
10
11export async function loader({ params, context }: Route.LoaderArgs) {
12 const path = { namespace: params.owner, name: params.repo };
13 return unwrap(
14 await env.REPOS.blob(path, getViewer(context), params.ref, params["*"] ?? ""),
15 );
16}
17
18export default function Blob({ loaderData }: Route.ComponentProps) {
19 return <BlobView blob={loaderData} />;
20}