import React from 'react';
import './index.less'

const Index = (props) => {
    const {data, onClick} = props;
    return (
        <div className="address-box">
            {data && data.length > 0 && data.map((item, index) => (
                <div key={index} className="good-item">
                    <div className="address-item address-title" onClick={() => onClick(item.BGYPMC)}>
                        品名：{item.BGYPMC || ''}
                        <img src="/img/rarrow.png" alt="" className={`icon18 ${item.checked ? 'icon-checked' : 'icon-unchecked'}`}/>
                    </div>
                    { item.checked && (
                        <div>
                            <div className="address-item address-title">
                                领取人：{item.BGYPMC || ''}
                            </div>
                            <div className="address-item address-title">
                                申请数量：{item.SL || ''}
                            </div>
                            <div className="address-item address-title">
                                实际发放数量：{item.BGYPMC || ''}
                            </div>
                        </div>
                    )}

                </div>
            ))}
        </div>
    );
};

export default Index;
