(props: MessageProps)
| 895 | } |
| 896 | |
| 897 | export function Message(props: MessageProps) { |
| 898 | return ( |
| 899 | <Switch> |
| 900 | <Match when={props.message.role === "user" && props.message}> |
| 901 | {(userMessage) => ( |
| 902 | <UserMessageDisplay |
| 903 | message={userMessage() as UserMessage} |
| 904 | parts={props.parts} |
| 905 | actions={props.actions} |
| 906 | useV2Actions={props.useV2Actions} |
| 907 | /> |
| 908 | )} |
| 909 | </Match> |
| 910 | <Match when={props.message.role === "assistant" && props.message}> |
| 911 | {(assistantMessage) => ( |
| 912 | <AssistantMessageDisplay |
| 913 | message={assistantMessage() as AssistantMessage} |
| 914 | parts={props.parts} |
| 915 | showAssistantCopyPartID={props.showAssistantCopyPartID} |
| 916 | showReasoningSummaries={props.showReasoningSummaries} |
| 917 | useV2Actions={props.useV2Actions} |
| 918 | /> |
| 919 | )} |
| 920 | </Match> |
| 921 | </Switch> |
| 922 | ) |
| 923 | } |
| 924 | |
| 925 | export function AssistantMessageDisplay(props: { |
| 926 | message: AssistantMessage |
nothing calls this directly
no test coverage detected