Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

userMessageIntentBadge.ts

27 lines766 Bytes

1import type { OrchestrationV2UserMessageInputIntent } from "@t3tools/contracts";
2​
3export interface UserMessageIntentBadgePresentation {
4 readonly label: string;
5 readonly accessibilityLabel: string;
6}
7​
8export function resolveUserMessageIntentBadge(
9 intent: OrchestrationV2UserMessageInputIntent | undefined,
10): UserMessageIntentBadgePresentation | null {
11 switch (intent) {
12 case "steer":
13 return {
14 label: "Steer",
15 accessibilityLabel: "Steered the active turn",
16 };
17 case "promoted_queued_to_steer":
18 return {
19 label: "Steer",
20 accessibilityLabel: "Originally queued, then promoted to steer the active turn",
21 };
22 case "queued_turn":
23 case "turn_start":
24 case undefined:
25 return null;
26 }