Files
kandev/apps/web/components/task/chat/context-items/context-item-renderer.tsx
T
José Almeida 8f2fe7a8e6 feat(web): add agent message comments (#1835)
* feat(web): add agent message comments

* fix(web): harden agent message comments

* fix(web): address message comment review findings

* fix(web): allow comments on legacy agent messages

* fix(web): address latest message comment review

* fix(web): address follow-up message comment review

* fix(web): address remaining message comment review

* fix(web): keep failed mobile comments open

* fix(web): preserve selections over message comments
2026-07-21 13:32:19 +01:00

45 lines
1.4 KiB
TypeScript

"use client";
import type { ContextItem } from "@/lib/types/context";
import { PlanItem } from "./plan-item";
import { FileItem } from "./file-item";
import { PromptItem } from "./prompt-item";
import { CommentItem } from "./comment-item";
import { PlanCommentItem } from "./plan-comment-item";
import { ImageItem } from "./image-item";
import { FileAttachmentItem } from "./file-attachment-item";
import { PRFeedbackItem } from "./pr-feedback-item";
import { WalkthroughCommentItem } from "./walkthrough-comment-item";
import { AgentMessageCommentItem } from "./agent-message-comment-item";
export function ContextItemRenderer({
item,
sessionId,
}: {
item: ContextItem;
sessionId?: string | null;
}) {
switch (item.kind) {
case "plan":
return <PlanItem item={item} />;
case "file":
return <FileItem item={item} sessionId={sessionId} />;
case "prompt":
return <PromptItem item={item} />;
case "comment":
return <CommentItem item={item} />;
case "plan-comment":
return <PlanCommentItem item={item} />;
case "image":
return <ImageItem item={item} />;
case "file-attachment":
return <FileAttachmentItem item={item} />;
case "pr-feedback":
return <PRFeedbackItem item={item} />;
case "walkthrough-comment":
return <WalkthroughCommentItem item={item} />;
case "agent-message-comment":
return <AgentMessageCommentItem item={item} />;
}
}