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 type { PullRequestStack } from "@t3tools/contracts"; |
| 2 | import { useMessages } from "gt-react"; |
| 3 | import { cn } from "~/lib/utils"; |
| 4 | import { resolvePullRequestState } from "./pullRequestPresentation"; |
| 5 | |
| 6 | export function PullRequestStackLayerContent({ |
| 7 | layer, |
| 8 | compact = false, |
| 9 | }: { |
| 10 | layer: PullRequestStack["layers"][number]; |
| 11 | compact?: boolean; |
| 12 | }) { |
| 13 | const messages = useMessages(); |
| 14 | const state = resolvePullRequestState( |
| 15 | { |
| 16 | state: layer.state, |
| 17 | isDraft: layer.isDraft ?? false, |
| 18 | }, |
| 19 | messages, |
| 20 | ); |
| 21 | return ( |
| 22 | <> |
| 23 | <state.Icon aria-hidden className={cn("size-4 shrink-0", state.toneClassName)} /> |
| 24 | <span className="min-w-0 flex-1"> |
| 25 | <span className="block truncate">{layer.title || layer.headBranch}</span> |
| 26 | <span className="block truncate text-xs font-normal text-muted-foreground"> |
| 27 | #{layer.number} · {compact ? null : `${layer.headBranch} · `} |
| 28 | {state.label} |
| 29 | </span> |
| 30 | </span> |
| 31 | </> |
| 32 | ); |
| 33 | } |