Change the icon to move just in the last message

This commit is contained in:
Cristhian Zanforlin Lousa 2023-05-31 21:21:51 -03:00
commit 893dc22fc4
2 changed files with 5 additions and 2 deletions

View file

@ -16,10 +16,13 @@ import Convert from "ansi-to-html";
export default function ChatMessage({
chat,
lockChat,
lastMessage
}: {
chat: ChatMessageType;
lockChat: boolean;
lastMessage: boolean;
}) {
const convert = new Convert({ newline: true });
const [message, setMessage] = useState("");
const imgRef = useRef(null);
@ -48,7 +51,7 @@ export default function ChatMessage({
"absolute transition-opacity duration-500 scale-150 " +
(lockChat ? "opacity-100" : "opacity-0")
}
src={AiIcon}
src={lastMessage ? AiIcon : AiIconStill}
/>
<img
className={

View file

@ -416,7 +416,7 @@ export default function ChatModal({
>
{chatHistory.length > 0 ? (
chatHistory.map((c, i) => (
<ChatMessage lockChat={lockChat} chat={c} key={i} />
<ChatMessage lockChat={lockChat} chat={c} lastMessage={chatHistory.length-1 == i ? true : false} key={i} />
))
) : (
<div className="flex flex-col h-full text-center justify-center w-full items-center align-middle">