import React from 'react'

export const Box = (h,w,b,t,options={}) => <div style={{
   margin : `${options.margin||0}`,
   padding : `${options.padding||0}`,
   height:`${h}`,
   width:`${w}`,
   background: `${b}`,
   display : 'flex',
   justifyContent : 'center',
   alignItems : 'center'
 }}>{typeof t=='function' && t() || t}</div>

export const CloseButton = close => () => <i onClick={close} style={{ color:'black', cursor:'pointer' }} className="material-icons">close</i>

export class ControlledRenderer extends React.Component{
	shouldComponentUpdate(){
		return this.props.shouldRender
	}

	render(){
		return this.props.render
	}
}