File size: 690 Bytes
4304c6d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'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
  currentIndex: number
  list: Collection[]
  onChosen: (index: number) => void
}

const ToolNavList: FC<Props> = ({

  className,

  currentIndex,

  list,

  onChosen,

}) => {
  return (
    <div className={cn(className)}>

      {list.map((item, index) => (

        <Item isCurrent={index === currentIndex} key={index} payload={item} onClick={() => onChosen(index)}></Item>

      ))}

    </div>
  )
}
export default React.memo(ToolNavList)