File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
web/src/app/publishers/[id]/agents/[agentId]/[version] Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { cn } from '@/lib/utils'
1515import { AgentUsageMetrics } from './agent-usage-metrics'
1616import { RunAgentButton } from './run-agent-button'
1717import { CopyIdButton } from './copy-id-button'
18+ import { SaveAgentButton } from './save-agent-button'
1819import { Button } from '@/components/ui/button'
1920
2021interface AgentDetailPageProps {
@@ -186,6 +187,7 @@ const AgentDetailPage = async ({ params }: AgentDetailPageProps) => {
186187 </ div >
187188 < div className = "flex items-end space-x-3" >
188189 < CopyIdButton agentId = { fullAgentId } />
190+ < SaveAgentButton agentId = { fullAgentId } />
189191 < RunAgentButton agentId = { fullAgentId } />
190192 { /*
191193 Hide download button for now. (It doesn't do anything)
Original file line number Diff line number Diff line change 1+ 'use client'
2+
3+ import { Copy } from 'lucide-react'
4+ import { Button } from '@/components/ui/button'
5+ import { toast } from '@/components/ui/use-toast'
6+
7+ interface SaveAgentButtonProps {
8+ agentId : string
9+ }
10+
11+ export function SaveAgentButton ( { agentId } : SaveAgentButtonProps ) {
12+ const handleCopy = ( ) => {
13+ navigator . clipboard . writeText ( `codebuff save-agent ${ agentId } ` )
14+ toast ( {
15+ description : `Command copied to clipboard: "codebuff save-agent ${ agentId } "` ,
16+ } )
17+ }
18+
19+ return (
20+ < Button
21+ variant = "outline"
22+ size = "sm"
23+ onClick = { handleCopy }
24+ className = "flex items-center gap-2"
25+ >
26+ < Copy className = "h-4 w-4" />
27+ Save this agent
28+ </ Button >
29+ )
30+ }
You can’t perform that action at this time.
0 commit comments