nexus/ui/src/components/ChatTaskCreatedBadge.tsx
Nexus Dev fab74e888c feat(23-02): add ChatTaskCreatedBadge, ChatStatusUpdateBadge, useBrainstormerDefault
- ChatTaskCreatedBadge renders loading state and resolved badge with View task link
- ChatStatusUpdateBadge renders CheckCircle2 + agent completion text with task link
- useBrainstormerDefault returns general role agent ID with React Query deduplication
- Fix ChatMessageList synthetic streaming entry to include messageType: null
2026-04-02 15:08:51 +00:00

40 lines
1.2 KiB
TypeScript

import { Link } from "@/lib/router";
import { cn } from "../lib/utils";
interface ChatTaskCreatedBadgeProps {
taskId?: string | null;
taskTitle?: string | null;
taskUrl?: string | null;
}
export function ChatTaskCreatedBadge({ taskId, taskTitle, taskUrl }: ChatTaskCreatedBadgeProps) {
if (!taskId) {
return (
<div className="motion-safe:animate-in motion-safe:fade-in motion-safe:slide-in-from-bottom-1 inline-flex items-center gap-2 rounded-md border border-border bg-card px-3 py-1 text-[13px] text-muted-foreground">
Creating task...
</div>
);
}
return (
<div
className={cn(
"motion-safe:animate-in motion-safe:fade-in motion-safe:slide-in-from-bottom-1",
"inline-flex items-center gap-2 rounded-md border border-border bg-card px-3 py-1 text-[13px]"
)}
role="status"
>
<span className="text-[11px] font-semibold text-muted-foreground">{taskId}</span>
<span className="text-foreground">{taskTitle}</span>
{taskUrl && (
<Link
to={taskUrl}
className="text-primary underline-offset-2 hover:underline"
aria-label={`View task ${taskId}`}
>
View task
</Link>
)}
</div>
);
}