mobile: show transcript preview for media particles in stream list
This commit is contained in:
@@ -75,10 +75,13 @@ export const StreamCard = memo(function StreamCard({
|
|||||||
if (!latestChild) return "No messages yet";
|
if (!latestChild) return "No messages yet";
|
||||||
if (isParticleDeleted(latestChild)) return "Message deleted";
|
if (isParticleDeleted(latestChild)) return "Message deleted";
|
||||||
switch (latestChild.type) {
|
switch (latestChild.type) {
|
||||||
case "media":
|
case "media": {
|
||||||
return latestChild.properties.mime_type.startsWith("audio/")
|
const mime = latestChild.properties.mime_type;
|
||||||
? "Voice message"
|
if (mime.startsWith("image/")) return "Photo";
|
||||||
: "Video message";
|
const transcriptText = latestChild.properties.transcript?.transcript;
|
||||||
|
if (transcriptText) return transcriptText;
|
||||||
|
return mime.startsWith("audio/") ? "Voice note" : "Video clip";
|
||||||
|
}
|
||||||
case "text":
|
case "text":
|
||||||
return latestChild.properties.content;
|
return latestChild.properties.content;
|
||||||
case "file":
|
case "file":
|
||||||
|
|||||||
Reference in New Issue
Block a user