import React from 'react' ; param cells param extraWidth export default function resetLeftForCells ( cells , extraWidth ? ) { let left = 0 ; const nextCells = [ ] ; for ( let i = 0 ; i < cells . length ; i ++ ) { const cell = cells [ i ] ; const nextCell = React . cloneElement ( cell , { left , width : i === cells . length - 1 && extraWidth ? cell . props . width + extraWidth : cell . props . width } ) ; left += cell . props . width ; nextCells . push ( nextCell ) ; } return nextCells ; }