mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-22 17:26:54 +08:00
feat: support assistant frontend (#2139)
Co-authored-by: StyleZhang <jasonapring2015@outlook.com>
This commit is contained in:
28
web/app/components/tools/tool-nav-list/index.tsx
Normal file
28
web/app/components/tools/tool-nav-list/index.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
'use client'
|
||||
import type { FC } from 'react'
|
||||
import React from 'react'
|
||||
import cn from 'classnames'
|
||||
import Item from './item'
|
||||
import type { Collection } from '@/app/components/tools/types'
|
||||
type Props = {
|
||||
className?: string
|
||||
currentName: string
|
||||
list: Collection[]
|
||||
onChosen: (index: number) => void
|
||||
}
|
||||
|
||||
const ToolNavList: FC<Props> = ({
|
||||
className,
|
||||
currentName,
|
||||
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>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default React.memo(ToolNavList)
|
||||
Reference in New Issue
Block a user