Skip to content

Commit 250b2fc

Browse files
committed
refactor(ui): complete inline-style migration for MessageAvatar component
1 parent 9b19a92 commit 250b2fc

1 file changed

Lines changed: 39 additions & 6 deletions

File tree

frontend/src/components/chat/MessageAvatar.tsx

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,48 @@ interface MessageAvatarProps {
66

77
export function MessageAvatar({ role }: MessageAvatarProps) {
88
const isUser = role === "user";
9+
10+
if (isUser) {
11+
return (
12+
<div
13+
style={{
14+
width: 30,
15+
height: 30,
16+
borderRadius: "50%",
17+
background: "var(--bg-elevated)",
18+
border: "1px solid var(--border-muted)",
19+
display: "flex",
20+
alignItems: "center",
21+
justifyContent: "center",
22+
fontSize: 11,
23+
fontWeight: 600,
24+
color: "var(--text-secondary)",
25+
flexShrink: 0,
26+
}}
27+
>
28+
U
29+
</div>
30+
);
31+
}
32+
933
return (
1034
<div
11-
className={`flex h-8 w-8 shrink-0 items-center justify-center rounded-md border text-xs font-semibold ${
12-
isUser
13-
? "border-[var(--border-muted)] bg-elevated text-[var(--text-primary)]"
14-
: "border-[var(--border-muted)] bg-surface font-mono text-[var(--text-primary)]"
15-
}`}
35+
style={{
36+
width: 30,
37+
height: 30,
38+
borderRadius: "50%",
39+
background: "linear-gradient(135deg, #4f8ef7 0%, #2563eb 100%)",
40+
display: "flex",
41+
alignItems: "center",
42+
justifyContent: "center",
43+
fontSize: 12,
44+
fontWeight: 700,
45+
color: "#fff",
46+
flexShrink: 0,
47+
boxShadow: "0 2px 8px rgba(79,142,247,0.3)",
48+
}}
1649
>
17-
{isUser ? "You" : "Q"}
50+
Q
1851
</div>
1952
);
2053
}

0 commit comments

Comments
 (0)