import { View, Input, Button } from '@tarojs/components'
import { useCallback, useEffect, useMemo, useRef, useState, memo } from 'react'
import styles from "./index.module.scss"
import classnames from "classnames";

interface Props {
    list: any[],
    handChose?: (any) => void
}
export default memo((props: Props) => {
    const { list = [], handChose } = props

    return (
        <View className={styles.flexBox}>
            {
                list.map((item, index) => {
                    return (
                        <View className={styles.itemBox} key={index} onClick={() => handChose?.(item)}>
                            <View
                                className={classnames(item.showBorder ? styles.activeItems : styles.itemFont)}

                            >{item?.name}</View >
                            {
                                item.showBorder && <View className={styles.borderBox} ></View>
                            }
                        </View >
                    )
                })
            }
        </View >
    )
})