fix: apply message background colors in fullscreen chat too
This commit is contained in:
parent
b95fb074b1
commit
a01bfbfc40
@ -130,8 +130,15 @@ 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 =
|
||||||
|
msg.author_type === "system"
|
||||||
|
? { backgroundColor: "rgba(161, 120, 0, 0.2)", borderRadius: 6, padding: "4px 8px" }
|
||||||
|
: msg.author_type === "agent"
|
||||||
|
? { backgroundColor: "rgba(0, 120, 60, 0.2)", borderRadius: 6, padding: "4px 8px" }
|
||||||
|
: 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">
|
<div className="flex items-center gap-1 text-xs text-[var(--muted)] mb-0.5">
|
||||||
<span>{AUTHOR_ICON[msg.author_type] || "👤"}</span>
|
<span>{AUTHOR_ICON[msg.author_type] || "👤"}</span>
|
||||||
<span className="font-medium">{msg.author_slug}</span>
|
<span className="font-medium">{msg.author_slug}</span>
|
||||||
@ -141,6 +148,7 @@ export default function ChatPanel({ chatId, fullscreen = false }: Props) {
|
|||||||
<div className="ml-5 whitespace-pre-wrap">{msg.content}</div>
|
<div className="ml-5 whitespace-pre-wrap">{msg.content}</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
if (fullscreen) {
|
if (fullscreen) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user