Matthias Nott
2026-03-02 a0f39302919fbacf7a0d407f01b1a50413ea6f70
components/chat/MessageBubble.tsx
....@@ -1,5 +1,5 @@
11 import React, { useCallback, useState } from "react";
2
-import { Pressable, Text, View } from "react-native";
2
+import { Image, Pressable, Text, View } from "react-native";
33 import { Message } from "../../types";
44 import { playAudio, stopPlayback } from "../../services/audio";
55
....@@ -57,7 +57,32 @@
5757 : "bg-pai-surface rounded-tl-sm"
5858 }`}
5959 >
60
- {message.type === "voice" ? (
60
+ {message.type === "image" && message.imageBase64 ? (
61
+ /* Image message */
62
+ <View>
63
+ <Image
64
+ source={{ uri: `data:image/png;base64,${message.imageBase64}` }}
65
+ style={{
66
+ width: 260,
67
+ height: 180,
68
+ borderRadius: 10,
69
+ backgroundColor: "#14141F",
70
+ }}
71
+ resizeMode="contain"
72
+ />
73
+ {message.content ? (
74
+ <Text
75
+ style={{
76
+ color: isUser ? "#FFF" : "#9898B0",
77
+ fontSize: 12,
78
+ marginTop: 4,
79
+ }}
80
+ >
81
+ {message.content}
82
+ </Text>
83
+ ) : null}
84
+ </View>
85
+ ) : message.type === "voice" ? (
6186 <Pressable
6287 onPress={handleVoicePress}
6388 className="flex-row items-center gap-3"