Skip to content

Commit 944d7cc

Browse files
committed
Store: Save this agent button
1 parent d7830af commit 944d7cc

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { cn } from '@/lib/utils'
1515
import { AgentUsageMetrics } from './agent-usage-metrics'
1616
import { RunAgentButton } from './run-agent-button'
1717
import { CopyIdButton } from './copy-id-button'
18+
import { SaveAgentButton } from './save-agent-button'
1819
import { Button } from '@/components/ui/button'
1920

2021
interface 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)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
}

0 commit comments

Comments
 (0)