Skip to content

Commit 132b473

Browse files
committed
Tweak agent page (copy id button)
1 parent 4898ed9 commit 132b473

File tree

1 file changed

+22
-8
lines changed
  • web/src/app/publishers/[id]/agents/[agentId]/[version]

1 file changed

+22
-8
lines changed

web/src/app/publishers/[id]/agents/[agentId]/[version]/page.tsx

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import { notFound } from 'next/navigation'
88
import { Badge } from '@/components/ui/badge'
99
import { Button } from '@/components/ui/button'
1010
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
11-
import { Separator } from '@/components/ui/separator'
1211
import { JsonViewer } from '@/components/agent/json-viewer'
12+
import { EnhancedCopyButton } from '@/components/ui/enhanced-copy-button'
1313
import { cn } from '@/lib/utils'
1414

1515
interface AgentDetailPageProps {
@@ -112,6 +112,15 @@ const AgentDetailPage = async ({ params }: AgentDetailPageProps) => {
112112
)
113113
.orderBy(schema.agentConfig.created_at)
114114

115+
// Get the latest version for the full agent ID
116+
const latestVersion =
117+
allVersions.sort(
118+
(a, b) =>
119+
new Date(b.created_at).getTime() - new Date(a.created_at).getTime()
120+
)[0]?.version || params.version
121+
122+
const fullAgentId = `${params.id}/${params.agentId}@${latestVersion}`
123+
115124
return (
116125
<div className="container mx-auto py-6 px-4">
117126
<div className="max-w-4xl mx-auto">
@@ -157,13 +166,18 @@ const AgentDetailPage = async ({ params }: AgentDetailPageProps) => {
157166
)}
158167
</span>
159168
</div>
160-
<div className="flex items-center space-x-1">
161-
<Code className="h-4 w-4" />
162-
<span>Agent ID: {params.agentId}</span>
163-
</div>
164169
</div>
165170
</div>
166-
<div className="flex space-x-2">
171+
<div className="flex flex-col items-end space-y-3">
172+
<div className="flex items-center space-x-2 text-sm">
173+
<code className="bg-muted/50 px-2 py-1 rounded text-xs font-mono text-muted-foreground">
174+
{publisherData.id}/{params.agentId}@{latestVersion}
175+
</code>
176+
<EnhancedCopyButton
177+
value={fullAgentId}
178+
className="p-1 text-muted-foreground/60 hover:text-muted-foreground"
179+
/>
180+
</div>
167181
<Button variant="outline" size="sm">
168182
<Download className="h-4 w-4 mr-2" />
169183
Download
@@ -209,10 +223,10 @@ const AgentDetailPage = async ({ params }: AgentDetailPageProps) => {
209223
{index === 0 && (
210224
<Badge
211225
className={cn(
212-
'text-xs px-1.5 py-0 border',
226+
'text-xs px-1.5 py-0 border pointer-events-none',
213227
version.version === params.version
214228
? 'bg-background text-foreground border-background'
215-
: 'bg-foreground text-background border-foreground'
229+
: 'bg-muted text-muted-foreground border-muted'
216230
)}
217231
>
218232
Latest

0 commit comments

Comments
 (0)