mirror of
				https://github.com/langgenius/dify.git
				synced 2025-10-31 19:03:09 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
		
			667 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			667 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| '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)
 | 
