Skip to content
This repository was archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
Improve [UI/UX] [Front End] [Chats] attach image (#284)
Browse files Browse the repository at this point in the history
- [+] feat(chat.tsx): replace img tags with next/image for better performance and add layout property as responsive
  • Loading branch information
H0llyW00dzZ authored Feb 24, 2024
1 parent a67a26f commit 51ff4dd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ import { appWindow } from '@tauri-apps/api/window';
import { sendDesktopNotification } from "../utils/taurinotification";
import { clearUnfinishedInputForSession, debouncedSave } from "../utils/storageHelper";
import { MultimodalContent } from "../client/api";
import Image from 'next/image';


const Markdown = dynamic(async () => (await import("./markdown")).Markdown, {
loading: () => <LoadingIcon />,
Expand Down Expand Up @@ -1725,10 +1727,11 @@ function _Chat() {
defaultShow={i >= messages.length - 6}
/>
{getMessageImages(message).length == 1 && (
<img
<Image
className={styles["chat-message-item-image"]}
src={getMessageImages(message)[0]}
alt=""
layout="responsive"
/>
)}
{getMessageImages(message).length > 1 && (
Expand All @@ -1742,13 +1745,14 @@ function _Chat() {
>
{getMessageImages(message).map((image, index) => {
return (
<img
<Image
className={
styles["chat-message-item-image-multi"]
}
key={index}
src={image}
alt=""
layout="responsive"
/>
);
})}
Expand Down

0 comments on commit 51ff4dd

Please sign in to comment.