feat: colored message backgrounds — yellow for system, green for agents
This commit is contained in:
parent
9b2026c5fa
commit
2210b6ae9f
@ -202,14 +202,22 @@ export default function ChatPanel({ chatId, fullscreen = false }: Props) {
|
||||
{loadingOlder && (
|
||||
<div className="text-center text-xs text-[var(--muted)] py-1">Загрузка...</div>
|
||||
)}
|
||||
{messages.map((msg) => (
|
||||
<div key={msg.id} className="text-sm">
|
||||
{messages.map((msg) => {
|
||||
const bgClass =
|
||||
msg.author_type === "system"
|
||||
? "bg-yellow-900/30 rounded px-2 py-1"
|
||||
: msg.author_type === "agent"
|
||||
? "bg-green-900/30 rounded px-2 py-1"
|
||||
: "";
|
||||
return (
|
||||
<div key={msg.id} className={`text-sm ${bgClass}`}>
|
||||
<span className="text-xs text-[var(--muted)]">
|
||||
{AUTHOR_ICON[msg.author_type] || "👤"} {msg.author_slug}
|
||||
</span>
|
||||
<span className="ml-2">{msg.content}</span>
|
||||
</div>
|
||||
))}
|
||||
);
|
||||
})}
|
||||
{messages.length === 0 && (
|
||||
<div className="text-sm text-[var(--muted)] italic py-4 text-center">Нет сообщений</div>
|
||||
)}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user