Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Zewed committed Jan 27, 2024
1 parent 17d5f8f commit bcb9a69
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
&.user {
align-self: flex-end;
background-color: Colors.$highlight;
box-shadow: 1px 1px rgba(0, 0, 0, 0.25);
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.25);
}

&.brain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export const MessageRow = React.forwardRef(
{children ?? (
<MessageContent
text={messageContent}
isUser={isUserSpeaker}
markdownClasses={markdownClasses}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import ReactMarkdown from "react-markdown";

export const MessageContent = ({
text,
isUser,
markdownClasses,
}: {
text: string;
isUser: boolean;
markdownClasses: string;
}): JSX.Element => {
const [showLog] = useState(true);
Expand Down Expand Up @@ -34,14 +36,15 @@ export const MessageContent = ({
} else {
setIsLog(false);
}
console.info(isUser);
}, [text]);

const { logs, cleanedText } = extractLog(text);

return (
<div data-testid="chat-message-text" className="mt-2">
<div data-testid="chat-message-text">
{isLog && showLog && logs.length > 0 && (
<div className="text-xs text-gray-600 bg-gray-100 p-2 rounded">
<div className="text-xs text-white-600 p-2 rounded">
<ReactMarkdown>{logs}</ReactMarkdown>
</div>
)}
Expand Down

0 comments on commit bcb9a69

Please sign in to comment.