| 1 | import { |
| 2 | type TerminalContextDraft, |
| 3 | formatTerminalContextLabel, |
| 4 | isTerminalContextExpired, |
| 5 | } from "~/lib/terminalContext"; |
| 6 | import type { ContextPresentationCapability } from "../contextPresentationRegistry"; |
| 7 | import { TerminalContextInlineChip } from "./TerminalContextInlineChip"; |
| 8 | |
| 9 | interface ComposerPendingTerminalContextChipProps { |
| 10 | context: TerminalContextDraft; |
| 11 | detailsMode: ContextPresentationCapability["details"]; |
| 12 | } |
| 13 | |
| 14 | export function ComposerPendingTerminalContextChip({ |
| 15 | context, |
| 16 | detailsMode, |
| 17 | }: ComposerPendingTerminalContextChipProps) { |
| 18 | const label = formatTerminalContextLabel(context); |
| 19 | const expired = isTerminalContextExpired(context); |
| 20 | |
| 21 | return ( |
| 22 | <TerminalContextInlineChip |
| 23 | label={label} |
| 24 | terminalLabel={context.terminalLabel} |
| 25 | lineStart={context.lineStart} |
| 26 | lineEnd={context.lineEnd} |
| 27 | text={context.text} |
| 28 | expired={expired} |
| 29 | detailsMode={detailsMode} |
| 30 | /> |
| 31 | ); |
| 32 | } |