anything-llm/frontend/src/components/ChatBubble/index.jsx
Sean Hatfield ca8bf52cce
Bug fixes ()
* fix black text for custom messages text

* fix file upload icon being stretched

* center github, docs, and discord icons in sidebar

* fix chat container being cut off on right side and tighter spacing between message

* fix default chat container being cut off on right side

* on create new workspace, take user to the workspace they just created instead of the home page

* add border to chat container and click outside user menu to close

* fix borders around all chat and settings containers to be consistent

* fix padding for default messages

* fix spacing between workspace items in sidebar

* fix margin around right side of chat, default, and settings containers to be the same as the left sidebar

---------

Co-authored-by: timothycarambat <rambat1010@gmail.com>
2023-11-27 15:09:55 -06:00

34 lines
999 B
JavaScript

import React from "react";
import Jazzicon from "../UserIcon";
import { userFromStorage } from "../../utils/request";
import {
AI_BACKGROUND_COLOR,
USER_BACKGROUND_COLOR,
} from "../../utils/constants";
export default function ChatBubble({ message, type, popMsg }) {
const isUser = type === "user";
const backgroundColor = isUser ? USER_BACKGROUND_COLOR : AI_BACKGROUND_COLOR;
return (
<div className={`flex justify-center items-end w-full ${backgroundColor}`}>
<div
className={`py-8 px-4 w-full flex gap-x-5 md:max-w-[800px] flex-col`}
>
<div className="flex gap-x-5">
<Jazzicon
size={36}
user={{ uid: isUser ? userFromStorage()?.username : "system" }}
role={type}
/>
<span
className={`whitespace-pre-line text-white font-normal text-sm md:text-sm flex flex-col gap-y-1 mt-2`}
>
{message}
</span>
</div>
</div>
</div>
);
}