fabro/apps/fabro-web/app/components/pull-request-chip.tsx
Bryan Helmkamp 6719a3cdac
refactor: simplify reviewed run cleanup
Reuse shared PR chip rendering, persist runtime stage handlers from events, and remove duplicated lifecycle/delete helpers found during review.
2026-05-08 23:29:08 -04:00

40 lines
754 B
TypeScript

import type { ReactNode } from "react";
import { GitPullRequestIcon } from "./icons";
export function PullRequestChip({
number,
url,
className = "inline-flex items-center gap-1.5 font-mono text-xs text-fg-muted",
iconClassName = "size-3",
children,
}: {
number: number;
url?: string;
className?: string;
iconClassName?: string;
children?: ReactNode;
}) {
const content = (
<>
<GitPullRequestIcon className={iconClassName} />
#{number}
{children}
</>
);
if (url == null) {
return <span className={className}>{content}</span>;
}
return (
<a
href={url}
target="_blank"
rel="noreferrer"
className={`${className} hover:text-fg`}
>
{content}
</a>
);
}