Scaffold web frontend: mock-backed chat + PDF split-view, Tailwind/shadcn
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import type { ChatMessage } from "@duoc-thu/shared-types";
|
||||
import { cn } from "./lib/utils";
|
||||
|
||||
export interface ChatBubbleProps {
|
||||
message: ChatMessage;
|
||||
}
|
||||
|
||||
export function ChatBubble({ message }: ChatBubbleProps) {
|
||||
const isUser = message.role === "user";
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"max-w-lg rounded-2xl px-4 py-3 text-[1.02rem] leading-relaxed shadow-sm",
|
||||
isUser
|
||||
? "ml-auto rounded-br-sm bg-primary text-primary-foreground"
|
||||
: "mr-auto rounded-bl-sm bg-muted text-foreground"
|
||||
)}
|
||||
>
|
||||
<p className="m-0 whitespace-pre-wrap">{message.content}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user