- Archive dormant apps (daemon, desktop, native, tui) and superseded packages/server into repos/ for reference - Archive 21 dead web components (chat page shell, work-os cluster, strays) into repos/web/; keep reused message-rendering primitives in components/chat - Merge @code/work-os into @code/primitives; work.ts absorbed via ./work subpath and barrel export; update all four importers - Add docs/futures.md tracking audio/video (blocked at Flue + provider), web layout cleanup, and message rendering quality - Repoint dev:zopu script to @code/agents (the live Flue server) - Note repos/ reference-code convention in AGENTS.md
57 lines
2.1 KiB
TypeScript
57 lines
2.1 KiB
TypeScript
import { ConversationEmptyState } from "@code/ui/components/ai-elements/conversation";
|
|
import { Button } from "@code/ui/components/button";
|
|
import { MobileChatMark } from "@code/ui/components/mobile-chat";
|
|
|
|
import { SUGGESTIONS } from "@/lib/chat/constants";
|
|
import type { ChatConversationProps } from "@/lib/chat/types";
|
|
|
|
import { ChatMessage } from "./chat-message";
|
|
import { ChatThinkingResponse } from "./chat-thinking-response";
|
|
|
|
export const ChatConversation = ({
|
|
historyReady,
|
|
messages,
|
|
onSuggestion,
|
|
status,
|
|
}: ChatConversationProps) => {
|
|
if (historyReady && messages.length === 0) {
|
|
return (
|
|
<ConversationEmptyState className="min-h-full items-start justify-end px-0 pt-14 pb-5 text-left">
|
|
<MobileChatMark className="size-10 rounded-[12px] [&_svg]:size-5" />
|
|
<div className="space-y-1">
|
|
<h2 className="text-[22px] font-semibold tracking-[-0.035em]">
|
|
What can I help with?
|
|
</h2>
|
|
<p className="max-w-[320px] text-[14px] leading-5 text-muted-foreground">
|
|
Think, write, plan, or explore an idea with Zopu.
|
|
</p>
|
|
</div>
|
|
<div className="mt-3 grid w-full gap-2">
|
|
{SUGGESTIONS.map(([title, prompt]) => (
|
|
<Button
|
|
key={title}
|
|
className="group h-auto min-h-14 w-full flex-col items-start justify-center gap-0.5 rounded-[16px] border-[#e7e7e4] bg-[#f7f7f5] px-4 py-3 text-left shadow-none transition-colors active:bg-[#eeeeeb]"
|
|
onClick={() => onSuggestion(prompt)}
|
|
variant="outline"
|
|
>
|
|
<span className="font-medium text-foreground">{title}</span>
|
|
<span className="text-xs leading-4 font-normal text-muted-foreground whitespace-normal">
|
|
{prompt}
|
|
</span>
|
|
</Button>
|
|
))}
|
|
</div>
|
|
</ConversationEmptyState>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<div className="flex min-w-0 flex-col gap-5 pb-5">
|
|
{messages.map((message) => (
|
|
<ChatMessage key={message.id} message={message} />
|
|
))}
|
|
{status === "submitted" && <ChatThinkingResponse />}
|
|
</div>
|
|
);
|
|
};
|