Skip to content

Commit 8667e5c

Browse files
committed
fix: clean up code
1 parent 6c23e1c commit 8667e5c

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

apps/site/components/Common/Searchbox/ChatActions/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const ChatActions: FC<ChatActionsProps> = ({ interaction }) => {
5252
}
5353
</ChatInteractions.CopyMessage>
5454
</li>
55-
{!interaction.loading && interaction.response && (
55+
{!interaction.loading && (
5656
<li>
5757
<button
5858
className={classNames(styles.chatAction, {

apps/site/components/Common/Searchbox/ChatInteractions/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const ChatInteractionsContainer = () => {
2525
onScroll={recalculateGoToBottomButton}
2626
onStreaming={recalculateGoToBottomButton}
2727
onNewInteraction={() => scrollToBottom({ animated: true })}
28-
className={`${styles.chatInteractionsWrapper}`}
28+
className={styles.chatInteractionsWrapper}
2929
>
3030
{(interaction: Interaction) => (
3131
<ChatMessage interaction={interaction} />

apps/site/components/Common/Searchbox/ChatMessage/index.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
'use client';
2-
31
import type { Interaction } from '@orama/core';
42
import { ChatInteractions } from '@orama/ui/components';
53
import type { FC } from 'react';
64

75
import styles from './index.module.css';
86
import { ChatActions } from '../ChatActions';
9-
import { ChatSources } from '../ChatSources';
7+
import ChatSources from '../ChatSources';
108

119
type ChatMessageProps = {
1210
interaction: Interaction;
@@ -39,13 +37,13 @@ export const ChatMessage: FC<ChatMessageProps> = ({ interaction }) => {
3937
</div>
4038
</ChatInteractions.Loading>
4139

42-
{interaction && interaction.response && (
40+
{interaction.response && (
4341
<div className={styles.chatAssistantMessageWrapper}>
4442
<ChatInteractions.AssistantMessage
4543
className={styles.chatAssistantMessage}
4644
markdownClassnames={{
4745
p: 'my-2 leading-relaxed',
48-
pre: `my-6 text-md overflow-x-auto hljs [&_pre]:bg-neutral-900! [&_pre]:text-sm [&_pre]:rounded-md [&_pre]:p-4 [&_pre]:whitespace-break-spaces wrap-break-word`,
46+
pre: 'my-6 text-md overflow-x-auto hljs [&_pre]:bg-neutral-900! [&_pre]:text-sm [&_pre]:rounded-md [&_pre]:p-4 [&_pre]:whitespace-break-spaces wrap-break-word',
4947
code: 'px-2 py-1 rounded text-sm whitespace-pre-wrap hljs bg-neutral-300 dark:bg-neutral-900',
5048
table: 'w-full border-collapse my-6',
5149
thead: 'dark:bg-neutral-900',

apps/site/components/Common/Searchbox/ChatSources/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use client';
2-
31
import type { Interaction, AnyObject } from '@orama/core';
42
import { ChatInteractions } from '@orama/ui/components';
53
import type { FC } from 'react';
@@ -12,7 +10,7 @@ type ChatSourcesProps = {
1210
interaction: Interaction;
1311
};
1412

15-
export const ChatSources: FC<ChatSourcesProps> = ({ interaction }) => {
13+
const ChatSources: FC<ChatSourcesProps> = ({ interaction }) => {
1614
if (!interaction?.sources) {
1715
return null;
1816
}
@@ -44,3 +42,5 @@ export const ChatSources: FC<ChatSourcesProps> = ({ interaction }) => {
4442
</ChatInteractions.Sources>
4543
);
4644
};
45+
46+
export default ChatSources;

0 commit comments

Comments
 (0)