import React from "react"
import style from './index.less'
import { CheckCircleFilled } from "@ant-design/icons"

/**
 * 推广产品
 * @param param0 
 * @returns 
 */
const NewRadio: React.FC<PULLIN.FormItemDataNewProps> = ({ data = [], value, onChange, id }) => {

    return <div className={style.newRadio} id={id}>
        {data.map((item, index) => <div onClick={() => onChange?.(item?.value)} key={item?.value || index} className={`${value === item.value ? style.newRadioActive : ''}`}>
            <div><CheckCircleFilled /></div>
            <span>{item?.label || item?.value || index}</span>
        </div>)}
    </div>
}

export default React.memo(NewRadio)