{elements.map((el) => el)}
- {image && }
+ {image && (
+ {
+ setImage(image);
+ }}
+ >
+
+
+ )}
{openGraph && (
window?.open(link, "_blank", "noopener")?.focus()}
@@ -87,13 +99,19 @@ export function ChatMessageContent({
);
}
-const MessageImage = styled.img`
+const MessageImageWrapper = styled.div`
width: 147px;
height: 196px;
- border-radius: 16px;
margin-top: 8px;
`;
+const MessageImage = styled.img`
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ border-radius: 16px;
+`;
+
const PreviewSiteNameWrapper = styled.div`
font-family: Inter;
font-style: normal;
diff --git a/packages/react-chat/src/components/Chat/ChatMessages.tsx b/packages/react-chat/src/components/Chat/ChatMessages.tsx
index 5be98dba..072ea35b 100644
--- a/packages/react-chat/src/components/Chat/ChatMessages.tsx
+++ b/packages/react-chat/src/components/Chat/ChatMessages.tsx
@@ -12,12 +12,16 @@ type ChatMessagesProps = {
messages: ChatMessage[];
loadNextDay: () => void;
fetchMetadata?: (url: string) => Promise;
+
+ setImage: (image: string) => void;
};
export function ChatMessages({
messages,
loadNextDay,
fetchMetadata,
+
+ setImage,
}: ChatMessagesProps) {
const [scrollOnBot, setScrollOnBot] = useState(true);
const ref = useRef(null);
@@ -80,6 +84,7 @@ export function ChatMessages({
diff --git a/packages/react-chat/src/components/Modals/Modal.tsx b/packages/react-chat/src/components/Modals/Modal.tsx
index ec10d6c4..0965bc35 100644
--- a/packages/react-chat/src/components/Modals/Modal.tsx
+++ b/packages/react-chat/src/components/Modals/Modal.tsx
@@ -44,7 +44,7 @@ export const Modal = ({