From 68c9cd4bd803bdb186c4ee6514f00239549a26a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=89VEIL?= Date: Wed, 5 Apr 2023 00:55:52 +0200 Subject: [PATCH] Fix 416 copy button on code block (#427) * update README regarding GOOGLE_API_KEY and GOOGLE_CSE_ID * :bug: fix copy button not showing up on code block with no recognized language fixes #416 --- components/Chat/ChatMessage.tsx | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/components/Chat/ChatMessage.tsx b/components/Chat/ChatMessage.tsx index 19481d8..5a762b8 100644 --- a/components/Chat/ChatMessage.tsx +++ b/components/Chat/ChatMessage.tsx @@ -1,5 +1,11 @@ import { Message } from '@/types/chat'; -import { IconCheck, IconCopy, IconEdit, IconUser, IconRobot } from '@tabler/icons-react'; +import { + IconCheck, + IconCopy, + IconEdit, + IconUser, + IconRobot, +} from '@tabler/icons-react'; import { useTranslation } from 'next-i18next'; import { FC, memo, useEffect, useRef, useState } from 'react'; import rehypeMathjax from 'rehype-mathjax'; @@ -81,7 +87,11 @@ export const ChatMessage: FC = memo( >
- {message.role === 'assistant' ? : } + {message.role === 'assistant' ? ( + + ) : ( + + )}
@@ -136,7 +146,7 @@ export const ChatMessage: FC = memo(