-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathAgentSessionTranscriptView.tsx
More file actions
63 lines (61 loc) · 2.02 KB
/
Copy pathAgentSessionTranscriptView.tsx
File metadata and controls
63 lines (61 loc) · 2.02 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { ArrowLeftIcon } from "@phosphor-icons/react";
import { useSetHeaderContent } from "@posthog/ui/hooks/useSetHeaderContent";
import { Flex, Text } from "@radix-ui/themes";
import { Link } from "@tanstack/react-router";
import { useMemo } from "react";
import { AgentBuilderHeaderControls } from "../agent-builder/AgentBuilderHeaderControls";
import { useSetAgentBuilderPage } from "../agent-builder/useSetAgentBuilderPage";
import { AgentSessionDetailBody } from "./AgentSessionDetailBody";
/**
* Full-screen session view: page chrome (back link + title) wrapping the shared
* {@link AgentSessionDetailBody} (KPI strip + Conversation/Logs tabs). The body
* renders the transcript read-only through code's native `ConversationView`.
*/
export function AgentSessionTranscriptView({
idOrSlug,
sessionId,
}: {
idOrSlug: string;
sessionId: string;
}) {
const headerContent = useMemo(
() => (
<Text className="truncate whitespace-nowrap font-medium text-[13px]">
Session
</Text>
),
[],
);
useSetHeaderContent(headerContent);
const pageContext = {
kind: "agent-session" as const,
slug: idOrSlug,
sessionId,
};
useSetAgentBuilderPage(pageContext);
return (
<Flex direction="column" className="h-full min-h-0">
<Flex
direction="column"
gap="2"
className="relative shrink-0 cursor-default select-none px-6 pt-5 pb-3"
>
<AgentBuilderHeaderControls />
<Link
to="/code/agents/applications/$idOrSlug/sessions"
params={{ idOrSlug }}
className="flex w-fit items-center gap-1.5 text-[12px] text-gray-11 no-underline hover:text-gray-12"
>
<ArrowLeftIcon size={13} />
Sessions
</Link>
<Text className="pr-44 font-bold text-[18px] text-gray-12 leading-tight tracking-tight">
Session transcript
</Text>
</Flex>
<div className="min-h-0 flex-1">
<AgentSessionDetailBody idOrSlug={idOrSlug} sessionId={sessionId} />
</div>
</Flex>
);
}