import { Component, ReactNode } from 'react';
import * as React from 'react';
import { EarnRow } from '../../models/nonstophome/earnRow';
import { EarnRowItem } from '../../models/nonstophome/earnRowItem';
import { EarnRowListItem } from './EarnRowListItem';

interface IEarnRowListProps {
    rows: EarnRow[];
    onSelect: (rowItem: EarnRowItem) => void;
}

export class EarnRowList extends Component<IEarnRowListProps, {}> {
    public render(): ReactNode {
        return (
            <div className='ns-body-grey'>
                <div className='ns-container'>
                    {this.props.rows.map((row) => <EarnRowListItem row={row} onSelect={this.props.onSelect} key={row.id} />)}
                </div>
            </div>
        );
    }
}