fix develop mode style

This commit is contained in:
2023-07-07 18:57:54 +08:00
parent 1da4d38799
commit 1c14e413bb

View File

@@ -51,7 +51,7 @@ export default function Message(props: Props) {
chat.role === "assistant" ? "justify-start" : "justify-end" chat.role === "assistant" ? "justify-start" : "justify-end"
}`} }`}
> >
<div className=" bg-"> <div>
<div <div
className={`relative w-fit p-2 rounded my-2 ${ className={`relative w-fit p-2 rounded my-2 ${
chat.role === "assistant" chat.role === "assistant"
@@ -59,28 +59,14 @@ export default function Message(props: Props) {
: "bg-green-400" : "bg-green-400"
} ${chat.hide ? "opacity-50" : ""}`} } ${chat.hide ? "opacity-50" : ""}`}
> >
{chatStore.develop_mode ? (
<textarea
className="message-content"
value={
chat.hide
? chat.content.split("\n")[0].slice(0, 16) + "... (deleted)"
: chat.content
}
onChange={(event: any) => {
chatStore.history[messageIndex].content = event.target.value;
setChatStore({ ...chatStore });
}}
></textarea>
) : (
<p className="message-content"> <p className="message-content">
{chat.hide {chat.hide
? chat.content.split("\n")[0].slice(0, 16) + "... (deleted)" ? chat.content.split("\n")[0].slice(0, 16) + "... (deleted)"
: chat.content} : chat.content}
</p> </p>
)}
<DeleteIcon /> <DeleteIcon />
</div> </div>
{chatStore.develop_mode && (
<div> <div>
token {chatStore.history[messageIndex].token} token {chatStore.history[messageIndex].token}
<button <button
@@ -104,6 +90,7 @@ export default function Message(props: Props) {
</button> </button>
</div> </div>
)}
</div> </div>
</div> </div>
</> </>