9 lines · 619 BRaw
| 1 | import { GitMergeIcon, GitPullRequestIcon } from "@refs/design-system/icons"; |
| 2 | import type { PullStatus } from "@refs/backend/contract"; |
| 3 | |
| 4 | export const STATUS_LABEL: Record<PullStatus, string> = { open: "Open", closed: "Closed", merged: "Merged" }; |
| 5 | |
| 6 | export function PullStatusIcon({ status, size = 16 }: { status: PullStatus; size?: number }) { |
| 7 | if (status === "merged") return <GitMergeIcon size={size} className="shrink-0 text-success" aria-label="Merged" />; |
| 8 | return <GitPullRequestIcon size={size} className={`shrink-0 ${status === "open" ? "text-success" : "text-danger"}`} aria-label={STATUS_LABEL[status]} />; |
| 9 | } |