The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import { |
| 2 | GitMergeIcon, |
| 3 | GitPullRequestArrowIcon, |
| 4 | GitPullRequestClosedIcon, |
| 5 | GitPullRequestDraftIcon, |
| 6 | LayersIcon, |
| 7 | Link2Icon, |
| 8 | Unlink2Icon, |
| 9 | TriangleAlertIcon, |
| 10 | } from "lucide-react"; |
| 11 | import type { PullRequestState } from "@t3tools/contracts"; |
| 12 | import { msg } from "gt-react"; |
| 13 | |
| 14 | export const PullRequestGlyph = { |
| 15 | pullRequest: GitPullRequestArrowIcon, |
| 16 | reopen: GitPullRequestArrowIcon, |
| 17 | draft: GitPullRequestDraftIcon, |
| 18 | closed: GitPullRequestClosedIcon, |
| 19 | merged: GitMergeIcon, |
| 20 | conflicting: TriangleAlertIcon, |
| 21 | stack: LayersIcon, |
| 22 | link: Link2Icon, |
| 23 | unlink: Unlink2Icon, |
| 24 | } as const; |
| 25 | |
| 26 | export type PullRequestGlyphIcon = (typeof PullRequestGlyph)[keyof typeof PullRequestGlyph]; |
| 27 | |
| 28 | export interface PullRequestStatePresentation { |
| 29 | readonly label: string; |
| 30 | readonly toneClassName: string; |
| 31 | readonly Icon: PullRequestGlyphIcon; |
| 32 | } |
| 33 | |
| 34 | export const PULL_REQUEST_STATE_PRESENTATION = { |
| 35 | open: { |
| 36 | label: msg("Open", { $context: "pull request state" }), |
| 37 | toneClassName: "text-emerald-600 dark:text-emerald-300/90", |
| 38 | Icon: PullRequestGlyph.pullRequest, |
| 39 | }, |
| 40 | draft: { |
| 41 | label: msg("Draft", { $context: "pull request state" }), |
| 42 | toneClassName: "text-zinc-500 dark:text-zinc-400/80", |
| 43 | Icon: PullRequestGlyph.draft, |
| 44 | }, |
| 45 | closed: { |
| 46 | label: msg("Closed", { $context: "pull request state" }), |
| 47 | toneClassName: "text-red-600 dark:text-red-300/90", |
| 48 | Icon: PullRequestGlyph.closed, |
| 49 | }, |
| 50 | merged: { |
| 51 | label: msg("Merged", { $context: "pull request state" }), |
| 52 | toneClassName: "text-violet-600 dark:text-violet-300/90", |
| 53 | Icon: PullRequestGlyph.merged, |
| 54 | }, |
| 55 | } as const satisfies Record<PullRequestState | "draft", PullRequestStatePresentation>; |