fix: apply message background colors in fullscreen chat too

This commit is contained in:
Markov 2026-02-24 13:21:19 +01:00
parent b95fb074b1
commit a01bfbfc40

View File

@ -130,17 +130,25 @@ export default function ChatPanel({ chatId, fullscreen = false }: Props) {
} }
}; };
const renderMessage = (msg: Message) => ( const renderMessage = (msg: Message) => {
<div key={msg.id} className="text-sm"> const bgStyle =
<div className="flex items-center gap-1 text-xs text-[var(--muted)] mb-0.5"> msg.author_type === "system"
<span>{AUTHOR_ICON[msg.author_type] || "👤"}</span> ? { backgroundColor: "rgba(161, 120, 0, 0.2)", borderRadius: 6, padding: "4px 8px" }
<span className="font-medium">{msg.author_slug}</span> : msg.author_type === "agent"
<span>·</span> ? { backgroundColor: "rgba(0, 120, 60, 0.2)", borderRadius: 6, padding: "4px 8px" }
<span>{new Date(msg.created_at).toLocaleString("ru-RU", { hour: "2-digit", minute: "2-digit" })}</span> : undefined;
return (
<div key={msg.id} className="text-sm" style={bgStyle}>
<div className="flex items-center gap-1 text-xs text-[var(--muted)] mb-0.5">
<span>{AUTHOR_ICON[msg.author_type] || "👤"}</span>
<span className="font-medium">{msg.author_slug}</span>
<span>·</span>
<span>{new Date(msg.created_at).toLocaleString("ru-RU", { hour: "2-digit", minute: "2-digit" })}</span>
</div>
<div className="ml-5 whitespace-pre-wrap">{msg.content}</div>
</div> </div>
<div className="ml-5 whitespace-pre-wrap">{msg.content}</div> );
</div> };
);
if (fullscreen) { if (fullscreen) {
return ( return (