fix icon sytle
This commit is contained in:
@@ -15,9 +15,6 @@ export default function Message(props: Props) {
|
|||||||
const [showCopiedHint, setShowCopiedHint] = useState(false);
|
const [showCopiedHint, setShowCopiedHint] = useState(false);
|
||||||
const DeleteIcon = () => (
|
const DeleteIcon = () => (
|
||||||
<button
|
<button
|
||||||
className={`absolute bottom-0 left-${
|
|
||||||
chat.content.length < 4 ? "0" : "2"
|
|
||||||
}`}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
chatStore.history[messageIndex].hide =
|
chatStore.history[messageIndex].hide =
|
||||||
!chatStore.history[messageIndex].hide;
|
!chatStore.history[messageIndex].hide;
|
||||||
@@ -50,9 +47,6 @@ export default function Message(props: Props) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<button
|
<button
|
||||||
className={`absolute bottom-0 right-${
|
|
||||||
chat.content.length < 4 ? "0" : "2"
|
|
||||||
}`}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigator.clipboard.writeText(chat.content);
|
navigator.clipboard.writeText(chat.content);
|
||||||
setShowCopiedHint(true);
|
setShowCopiedHint(true);
|
||||||
@@ -86,20 +80,22 @@ export default function Message(props: Props) {
|
|||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
className={`relative w-fit p-2 rounded my-2 ${
|
className={`w-fit p-2 rounded my-2 ${
|
||||||
chat.role === "assistant"
|
chat.role === "assistant"
|
||||||
? "bg-white dark:bg-gray-700 dark:text-white"
|
? "bg-white dark:bg-gray-700 dark:text-white"
|
||||||
: "bg-green-400"
|
: "bg-green-400"
|
||||||
} ${chat.hide ? "opacity-50" : ""}`}
|
} ${chat.hide ? "opacity-50" : ""}`}
|
||||||
>
|
>
|
||||||
<p className="message-content mb-3">
|
<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>
|
||||||
|
<div className="w-full flex justify-between">
|
||||||
<DeleteIcon />
|
<DeleteIcon />
|
||||||
<CopyIcon />
|
<CopyIcon />
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{showCopiedHint && <CopiedHint />}
|
{showCopiedHint && <CopiedHint />}
|
||||||
{chatStore.develop_mode && (
|
{chatStore.develop_mode && (
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
Reference in New Issue
Block a user