mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 22:34:00 +01:00
parent
0d629a614a
commit
68562b699f
|
@ -38,7 +38,7 @@ const ChatContent = () => {
|
||||||
}
|
}
|
||||||
}, [generating]);
|
}, [generating]);
|
||||||
|
|
||||||
const { handleSubmit, error } = useSubmit();
|
const { error } = useSubmit();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex-1 overflow-hidden'>
|
<div className='flex-1 overflow-hidden'>
|
||||||
|
|
|
@ -69,9 +69,7 @@ const ContentView = React.memo(
|
||||||
messageIndex: number;
|
messageIndex: number;
|
||||||
}) => {
|
}) => {
|
||||||
const { handleSubmit } = useSubmit();
|
const { handleSubmit } = useSubmit();
|
||||||
|
|
||||||
const [isDelete, setIsDelete] = useState<boolean>(false);
|
const [isDelete, setIsDelete] = useState<boolean>(false);
|
||||||
const [copied, setCopied] = useState<boolean>(false);
|
|
||||||
const currentChatIndex = useStore((state) => state.currentChatIndex);
|
const currentChatIndex = useStore((state) => state.currentChatIndex);
|
||||||
const setChats = useStore((state) => state.setChats);
|
const setChats = useStore((state) => state.setChats);
|
||||||
const lastMessageIndex = useStore((state) =>
|
const lastMessageIndex = useStore((state) =>
|
||||||
|
@ -121,8 +119,9 @@ const ContentView = React.memo(
|
||||||
components={{
|
components={{
|
||||||
code({ node, inline, className, children, ...props }) {
|
code({ node, inline, className, children, ...props }) {
|
||||||
if (inline) return <code>{children}</code>;
|
if (inline) return <code>{children}</code>;
|
||||||
let highlight;
|
const [copied, setCopied] = useState<boolean>(false);
|
||||||
|
|
||||||
|
let highlight;
|
||||||
const match = /language-(\w+)/.exec(className || '');
|
const match = /language-(\w+)/.exec(className || '');
|
||||||
const lang = match && match[1];
|
const lang = match && match[1];
|
||||||
const isMatch = lang && hljs.getLanguage(lang);
|
const isMatch = lang && hljs.getLanguage(lang);
|
||||||
|
|
Loading…
Reference in a new issue