+ {/* Add profile picture for received messages */}
+ {!isAuthor && (
+
+

onProfileClick(message.username)}
+ style={{ cursor: "pointer" }}
+ onError={(e) => {
+ const target = e.target as HTMLImageElement;
+ target.src = defaultAvatar;
+ }}
+ />
+
+ )}
+
+ {!isAuthor && (
+
onProfileClick(message.username)}
+ style={{ cursor: "pointer" }}> {/* TODO extract to SCSS */}
+ {message.username}
+
+ )}
+
+ {/* Add reply preview if this is a reply */}
+ {message.reply_to && (
+
+
+ {message.reply_to.username}
+ {message.reply_to.content}
+
+
+ )}
+
+
+ {message.content}
+
+
+
+ {formatTime(message.timestamp)}
+ {message.is_edited ? " (edited)" : undefined}
+
+ {isAuthor && message.is_read ? (
+
+ ) : undefined}
+
+