flagon-io/g1t

public

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

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

20 lines742 bytesCodeBlame
1import type { Route } from "./+types/tree";
2import { TreeView } from "../../components/repo-view";
3import { repos } from "../../lib/services.server";
4import { getViewer, unwrap } from "../../lib/session.server";
5
6export function meta({ params }: Route.MetaArgs) {
7 const path = params["*"] ? `${params["*"]} · ` : "";
8 return [{ title: `${path}${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 repos.tree(path, getViewer(context), params.ref, params["*"] ?? ""),
15 );
16}
17
18export default function Tree({ loaderData }: Route.ComponentProps) {
19 return <TreeView tree={loaderData} />;
20}