import { LayerCard } from "@refs/design-system"; import { WarningIcon } from "@refs/design-system/icons"; import { Avatar, formatDate } from "@refs/design-system"; import { narrative, parseDecisions } from "@refs/protocol"; import type { Route } from "./+types/repo-commit"; import { DecisionView } from "../components/decision-view"; import { DiffView } from "../components/diff-view"; import { found, refs, fullName } from "../lib/session"; export const meta: Route.MetaFunction = ({ loaderData, params }) => [{ title: loaderData ? `${loaderData.commit.message.split("\n")[0]} · ${fullName(params)} · refs` : `Commit · ${fullName(params)} · refs` }]; export async function loader({ params, context }: Route.LoaderArgs) { const repo = await found(refs(context).repo(fullName(params))); const commit = await found(repo.commit(params.hash)); return { repo: repo.summary.name, commit }; } export default function RepoCommit({ loaderData }: Route.ComponentProps) { const { repo, commit } = loaderData; const title = commit.message.split("\n")[0]; const story = narrative(commit.message); const { decisions, problems } = parseDecisions(commit.message, commit.hash); const parentLink = (hash: string) => ( {hash.slice(0, 7)} ); return (
{story}
}A decision record here could not be read. {problem.message}
))} {decisions.map((record, index) => (