All files / src/apps/user/pages/agents/agent Chat.tsx

100% Statements 4/4
100% Branches 0/0
100% Functions 1/1
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26                        8x 32x 32x 32x                    
import AgentChatView from "@/components/chat/AgentChat/AgentChatView";
import { useResourceId } from "@/components/detail";
import React from "react";
import { useSearchParams } from "react-router-dom";
 
/**
 * The agent chat page: the agent named by the route, and the turn a
 * `?conversation=<id>&message=<id>` deep link points at — Activity and
 * Governance → Rules → Activity link here rather than to the chat at
 * whatever it happens to be showing. The chat itself is `AgentChatView`,
 * which the chat dock draws too.
 */
const AgentChat: React.FC = () => {
  const agentId = useResourceId("agentId");
  const [searchParams] = useSearchParams();
  return (
    <AgentChatView
      agentId={agentId}
      linkedConversationId={searchParams.get("conversation")}
      linkedMessageId={searchParams.get("message")}
    />
  );
};
 
export default AgentChat;