import React from 'react';

import './Grid.scss';

export default (props) => {
    let cn = [props.className];
    let {
        item,
        direction,
        children
    } = props;

    //console.warn(props);
    
    //construct css class
    if (!!item) {
        cn.push("grid-item");
    } else {
        cn.push("grid-container");
    }
    if (direction) {
      cn.push(direction);
    }

    let className = cn.filter(c => !!c).join(" ");

    return (
        <div className={ className }>
            { children }
        </div>
    );
}