Skip to content

Commit 04353af

Browse files
authored
Merge pull request #111 from ssdeanx/develop
feat: implement initial application UI, core agent components, workfl…
2 parents 4ef0d72 + a927d42 commit 04353af

6 files changed

Lines changed: 450 additions & 98 deletions

File tree

app/chat/components/chat-header.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ import {
6666
} from 'lucide-react'
6767
import { useMemo, useState, useCallback } from 'react'
6868
import { cn } from '@/lib/utils'
69+
import { usePathname, useRouter, useSearchParams } from 'next/navigation'
6970

7071
const DEFAULT_MAX_TOKENS = 128000
7172

@@ -95,9 +96,17 @@ export function ChatHeader() {
9596

9697
const agentsByCategory = useMemo(() => getAgentsByCategory(), [])
9798
const modelsByProvider = useMemo(() => getModelsByProvider(), [])
99+
const router = useRouter()
100+
const pathname = usePathname()
101+
const searchParams = useSearchParams()
98102

99103
const handleSelectAgent = (agent: AgentConfig) => {
100104
selectAgent(agent.id)
105+
106+
const nextParams = new URLSearchParams(searchParams.toString())
107+
nextParams.set('agent', agent.id)
108+
router.replace(`${pathname}?${nextParams.toString()}`)
109+
101110
setAgentSelectorOpen(false)
102111
}
103112

0 commit comments

Comments
 (0)