import React from 'react'
import PropTypes from 'prop-types'

import styles from './styles.scss'
import BEMModule from 'utils/bem'
const bem = new BEMModule(styles)

const TradeTableGetStarted = ({colSpan, getStartedSteps}) => {
    if (!getStartedSteps || getStartedSteps.length < 1) {
        return null
    }

    const rootClassNames = bem.classNames('c-trade-table-table-get-started')
    return (
        <tr>
            <td colSpan={colSpan} className={rootClassNames}>
                <ol>
                    {getStartedSteps.map((step, i) => (
                        <li key={i}>{step}</li>
                    ))}
                </ol>
            </td>
        </tr>
    )
}

TradeTableGetStarted.propTypes = {
    colSpan: PropTypes.number,
    getStartedSteps: PropTypes.arrayOf(PropTypes.string),
}

TradeTableGetStarted.defaultProps = {
    colSpan: 6,
}

export default TradeTableGetStarted
