perf: replace img with Next.js Image for avatars

This commit is contained in:
Nishant-k-sagar 2026-03-24 22:38:21 +00:00
parent 8232893fbb
commit 6f64a2de9b
2 changed files with 8 additions and 2 deletions

View file

@ -1,6 +1,7 @@
import { ActionBarPrimitive, MessagePrimitive, useAssistantState } from "@assistant-ui/react";
import { useAtomValue } from "jotai";
import { FileText, Pen } from "lucide-react";
import Image from "next/image";
import { type FC, useState } from "react";
import { messageDocumentsMapAtom } from "@/atoms/chat/mentioned-documents.atom";
import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button";
@ -24,9 +25,11 @@ const UserAvatar: FC<AuthorMetadata> = ({ displayName, avatarUrl }) => {
if (avatarUrl && !hasError) {
return (
<img
<Image
src={avatarUrl}
alt={displayName || "User"}
width={32}
height={32}
className="size-8 rounded-full object-cover"
referrerPolicy="no-referrer"
onError={() => setHasError(true)}