import React from "react"
import style from './index.less'
import { Tooltip } from "antd"


/**
 * 新的radio杨撒
 * @returns 
 */
const New2Radio: React.FC<PULLIN.FormItemDataNew2Props> = ({ data = [], value, onChange, id }) => {

    return <div id={id} className={style.new2Radio}>
        {data.map(item => <Tooltip title={item?.tooltip} open={item?.tooltip ? undefined : false} key={item.value}>
            <div className={`${style.spaui_utton} ${value === item.value ? style.active : ''}`} onClick={() => onChange?.(item.value)}>
                {item?.img && <img className={style.img} src={item?.img} />}
                <span>{item?.label}</span>
                {item?.isGeneral && <span className={style.tag_top_right}>通投</span>}
            </div>
        </Tooltip>)}
    </div>
}

export default React.memo(New2Radio)