(props: { message: UserMessage; parts: PartType[] })
| 74 | } |
| 75 | |
| 76 | export function UserMessageDisplay(props: { message: UserMessage; parts: PartType[] }) { |
| 77 | const text = createMemo(() => |
| 78 | props.parts |
| 79 | ?.filter((p) => p.type === "text" && !(p as TextPart).synthetic) |
| 80 | ?.map((p) => (p as TextPart).text) |
| 81 | ?.join(""), |
| 82 | ) |
| 83 | return <div data-component="user-message">{text()}</div> |
| 84 | } |
| 85 | |
| 86 | export function Part(props: MessagePartProps) { |
| 87 | const component = createMemo(() => PART_MAPPING[props.part.type]) |