(message: Message)
| 16 | }; |
| 17 | |
| 18 | function estimateMessageHeight(message: Message): number { |
| 19 | const text = |
| 20 | typeof message.content === "string" |
| 21 | ? message.content |
| 22 | : message.content |
| 23 | .filter((b): b is { type: "text"; text: string } => b.type === "text") |
| 24 | .map((b) => b.text) |
| 25 | .join(""); |
| 26 | |
| 27 | if (text.length < 100) return ESTIMATED_HEIGHT.short; |
| 28 | if (text.length < 500 || text.includes("```")) return ESTIMATED_HEIGHT.medium; |
| 29 | return ESTIMATED_HEIGHT.tall; |
| 30 | } |
| 31 | |
| 32 | interface VirtualMessageListProps { |
| 33 | messages: Message[]; |
no outgoing calls
no test coverage detected