Feat/model as tool (#2744)

This commit is contained in:
Yeuoly
2024-03-08 15:22:55 +08:00
committed by GitHub
parent 3231a8c51c
commit 40c646cf7a
26 changed files with 840 additions and 43 deletions

View File

@@ -6,21 +6,21 @@ import Item from './item'
import type { Collection } from '@/app/components/tools/types'
type Props = {
className?: string
currentName: string
currentIndex: number
list: Collection[]
onChosen: (index: number) => void
}
const ToolNavList: FC<Props> = ({
className,
currentName,
currentIndex,
list,
onChosen,
}) => {
return (
<div className={cn(className)}>
{list.map((item, index) => (
<Item isCurrent={item.name === currentName} key={item.name} payload={item} onClick={() => onChosen(index)}></Item>
<Item isCurrent={index === currentIndex} key={index} payload={item} onClick={() => onChosen(index)}></Item>
))}
</div>
)