From b87e337edbf46c7591e97a2c8f91b5ffdbf0f337 Mon Sep 17 00:00:00 2001 From: Max Sveshnikov Date: Sun, 28 Apr 2024 19:31:13 +0200 Subject: [PATCH] Paste inage to input --- src/components/ChatInput.js | 48 ++++++++++++++++++++++++------------- src/components/Main.js | 2 ++ 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/src/components/ChatInput.js b/src/components/ChatInput.js index 13f05b51..2066e17e 100644 --- a/src/components/ChatInput.js +++ b/src/components/ChatInput.js @@ -1,5 +1,5 @@ import React from "react"; -import { Box, TextField, Button } from "@mui/material"; +import { Box, TextField, Button, Typography } from "@mui/material"; import FileSelector from "./FileSelector"; import { models } from "./Settings"; @@ -26,22 +26,36 @@ const ChatInput = ({ return ( - setInput(e.target.value)} - onKeyPress={(e) => { - if (e.key === "Enter") { - onSubmit(); - } - }} - multiline - minRows={1} - maxRows={6} - onPaste={handlePaste} - /> + + setInput(e.target.value)} + onKeyPress={(e) => { + if (e.key === "Enter") { + onSubmit(); + } + }} + multiline + minRows={1} + maxRows={6} + onPaste={handlePaste} + /> + {pastedImage && ( + + Pasted Image: + Pasted + + )} +