/**
 * @file Address.tsx
 * @author lihuanji
 *
 * 地址选择展示
 */

import React from 'react';
import classnames from 'classnames';
import Line from './Line';
import Info from './Info';

interface AddressFace {
    /**
     * class
     */
    className?: string;
    /**
     * 收货人姓名
     */
    name?: string;
    /**
     * 手机号码
     */
    phone?: string;
    /**
     * 详细的收货地址
     */
    detail?: string;
    /**
     * 点击跳转
     */
    onClick?: React.ReactEventHandler<EventTarget>;
}

const Address: React.StatelessComponent<AddressFace> = props => {
    const { className, onClick, ...other } = props;
    return (
        <div
            className={classnames('address-component', className)}
            onClick={onClick}
        >
            <Info {...other} />
        </div>
    );
};

Address.defaultProps = {
    onClick: () => {}
};

export default Address;

export { Line, Info };
