Add basic implementation for chat side panel components

This commit is contained in:
sabaimran
2024-07-02 21:56:43 +05:30
parent 0ee7cc8c47
commit 8a6722ba97
13 changed files with 476 additions and 84 deletions

View File

@@ -14,7 +14,7 @@ div.chatMessageWrapper {
div.khojfullHistory {
border-color: var(--border-color);
border-width: 1px;
padding-left: 24px;
padding-left: 4px;
}
div.youfullHistory {
@@ -105,6 +105,7 @@ button.codeCopyButton:hover {
}
div.feedbackButtons img,
button.codeCopyButton img,
button.copyButton img {
width: 24px;
}

View File

@@ -154,6 +154,7 @@ export default function ChatMessage(props: ChatMessageProps) {
useEffect(() => {
if (messageRef.current) {
const preElements = messageRef.current.querySelectorAll('pre > .hljs');
console.log("make copy button");
preElements.forEach((preElement) => {
const copyButton = document.createElement('button');
const copyImage = document.createElement('img');
@@ -212,7 +213,8 @@ export default function ChatMessage(props: ChatMessageProps) {
classes.push(styles[chatMessage.by]);
if (chatMessage.by === "khoj") {
classes.push(`border-l-4 border-opacity-50 border-l-orange-500 border-l-${props.borderLeftColor}`);
const dynamicBorderColor = `border-l-${props.borderLeftColor}`;
classes.push(`border-l-4 border-opacity-50 border-l-orange-400 ${dynamicBorderColor}`);
}
return classes.join(' ');