Spaces:
Runtime error
Runtime error
File size: 2,209 Bytes
c5cf697 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | /** Compact role badge + label for chat bubbles (professional, not playful). */
export function MessageRoleSticker({ role }) {
if (role === 'user') {
return (
<div className="flex shrink-0 flex-col items-center gap-1">
<div
className="flex h-11 w-11 items-center justify-center rounded-2xl bg-gradient-to-br from-comsats-purple via-[#4b2e83] to-[#2d1a52] text-white shadow-[0_6px_20px_-4px_rgba(75,46,131,0.45)] ring-2 ring-white/50"
aria-hidden
>
<svg className="h-6 w-6 opacity-[0.98]" viewBox="0 0 24 24" fill="currentColor" aria-hidden>
<path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v1c0 .55.45 1 1 1h14c.55 0 1-.45 1-1v-1c0-2.66-5.33-4-8-4z" />
</svg>
</div>
<span className="select-none text-[9px] font-bold uppercase tracking-[0.15em] text-comsats-purple/85">
You
</span>
</div>
)
}
return (
<div className="flex shrink-0 flex-col items-center gap-1">
<div
className="relative flex h-11 w-11 items-center justify-center overflow-hidden rounded-2xl bg-white shadow-[0_4px_16px_-6px_rgba(0,94,184,0.35)] ring-2 ring-comsats-blue/30"
aria-hidden
>
<span className="absolute inset-0 bg-gradient-to-br from-comsats-blue/[0.14] via-white to-comsats-purple/[0.12]" />
<svg
className="relative h-[22px] w-[22px] text-comsats-blue"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="1.75"
aria-hidden
>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 002.25-2.25V6.75a2.25 2.25 0 00-2.25-2.25H6.75A2.25 2.25 0 004.5 6.75v10.5a2.25 2.25 0 002.25 2.25zm.75-12h9v9h-9v-9z"
/>
</svg>
</div>
<span className="max-w-[3.25rem] select-none text-center text-[8px] font-bold uppercase leading-tight tracking-[0.08em] text-comsats-blue">
Assistant
</span>
</div>
)
}
|