import React from 'react';
import './GridComponent.css';

export default props => {
  const style = {
    style: {
      gridRowStart: Math.floor(props.row + 1),
      gridRowEnd: 'span ' + Math.floor(props.rowSpan || 1),
      gridColumnStart: Math.floor(props.col + 1),
      gridColumnEnd: 'span ' + Math.floor(props.colSpan || 1)
    }
  };

  return (
    <div className={'GridComponent'} {...style}>
      {props.children}
    </div>
  );

};