From af630f53d0e52ab009477eac5f751a74ac22b39e Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Sat, 8 Jul 2023 20:45:53 +0800 Subject: [PATCH] copy to clipboard and fix del icon style --- src/message.tsx | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/src/message.tsx b/src/message.tsx index 36b1790..369374b 100644 --- a/src/message.tsx +++ b/src/message.tsx @@ -12,10 +12,11 @@ export default function Message(props: Props) { const { chatStore, messageIndex, setChatStore } = props; const chat = chatStore.history[messageIndex]; const [showEdit, setShowEdit] = useState(false); + const [showCopiedHint, setShowCopiedHint] = useState(false); const DeleteIcon = () => ( ); + const CopiedHint = () => ( + + Message Copied to clipboard! + + ); + + const CopyIcon = () => { + return ( + <> + + + ); + }; + return ( <> {chatStore.postBeginIndex !== 0 && @@ -62,13 +92,15 @@ export default function Message(props: Props) { : "bg-green-400" } ${chat.hide ? "opacity-50" : ""}`} > -

+

{chat.hide ? chat.content.split("\n")[0].slice(0, 16) + "... (deleted)" : chat.content}

+ + {showCopiedHint && } {chatStore.develop_mode && (
token{" "}