Replace ChatBubbleAvatar with improved layout in Message component; update MessageHide component to use Badge for context indication
This commit is contained in:
@@ -124,7 +124,6 @@ export default function Message(props: Props) {
|
|||||||
variant={chat.role === "assistant" ? "received" : "sent"}
|
variant={chat.role === "assistant" ? "received" : "sent"}
|
||||||
className={chat.role !== "assistant" ? "flex-row-reverse" : ""}
|
className={chat.role !== "assistant" ? "flex-row-reverse" : ""}
|
||||||
>
|
>
|
||||||
<ChatBubbleAvatar fallback={chat.role === "assistant" ? "AI" : "US"} />
|
|
||||||
<ChatBubbleMessage isLoading={false}>
|
<ChatBubbleMessage isLoading={false}>
|
||||||
{chat.hide ? (
|
{chat.hide ? (
|
||||||
<MessageHide chat={chat} />
|
<MessageHide chat={chat} />
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { ChatStoreMessage } from "@/types/chatstore";
|
import { ChatStoreMessage } from "@/types/chatstore";
|
||||||
import { getMessageText } from "@/chatgpt";
|
import { getMessageText } from "@/chatgpt";
|
||||||
|
import { Badge } from "./components/ui/badge";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
chat: ChatStoreMessage;
|
chat: ChatStoreMessage;
|
||||||
@@ -9,9 +10,7 @@ export function MessageHide({ chat }: Props) {
|
|||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
||||||
<span>{getMessageText(chat).split("\n")[0].slice(0, 18)} ...</span>
|
<span>{getMessageText(chat).split("\n")[0].slice(0, 18)} ...</span>
|
||||||
<span className="rounded-md bg-secondary px-2 py-1 text-xs">
|
<Badge variant="secondary">Removed from context</Badge>
|
||||||
Removed from context
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user