import '../styles/components/grid.scss'
import Context from '../redux/context'
import { useContext } from 'react'
import GridViewHeader from './partials/GridViewHeader'
import GridViewBody from './partials/GridViewBody'
import { ___template } from '../helpers'

const Grid = () => {
  const { route, grid, storage } = useContext(Context)

  return (
    <table className={grid.parentClassList}>
      <GridViewHeader template={grid[___template(route)]}/>
      <GridViewBody data={storage} route={route}/>
    </table>
  )
}

export default Grid