mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-07 22:10:21 +08:00
- Implemented mergeObjects function to smartly merge objects, preserving existing values and allowing for configurable overwrite options. - Added mergeModelsList and mergeProvidersList functions to handle merging of model and provider lists, respectively, with case-insensitive ID matching. - Introduced preset merge strategies for common use cases. - Created a new API route for syncing provider models, handling data import and merge operations. - Developed ModelEditForm and ProviderEditForm components for editing model and provider details, respectively, with form validation and state management. - Added UI components for labels, selects, and notifications to enhance user experience.
32 lines
696 B
TypeScript
32 lines
696 B
TypeScript
'use client'
|
|
|
|
import Link from 'next/link'
|
|
import { usePathname } from 'next/navigation'
|
|
|
|
import { cn } from '@/lib/utils'
|
|
|
|
const navigation = [
|
|
{ name: 'Models', href: '/' },
|
|
{ name: 'Providers', href: '/providers' }
|
|
]
|
|
|
|
export function Navigation() {
|
|
const pathname = usePathname()
|
|
|
|
return (
|
|
<nav className="flex space-x-8">
|
|
{navigation.map((item) => (
|
|
<Link
|
|
key={item.name}
|
|
href={item.href}
|
|
className={cn(
|
|
'text-sm font-medium transition-colors hover:text-primary',
|
|
pathname === item.href ? 'text-foreground' : 'text-muted-foreground'
|
|
)}>
|
|
{item.name}
|
|
</Link>
|
|
))}
|
|
</nav>
|
|
)
|
|
}
|