import { useWindowSize } from "react-use" ; const MOBILE_BREAKPOINT = 536 ; const GRID_PADDING = 32 ; const TOOLBAR_WIDTH = 17 ; const MAX_GRID_WIDTH = 1120 ; const ITEM_WIDTH = 168 ; const ITEM_WIDTH_MOBILE = 108 ; export default ( ) : number => { const { width } = useWindowSize ( ) ; const itemWidth = width <= MOBILE_BREAKPOINT ? ITEM_WIDTH_MOBILE : ITEM_WIDTH ; return Math . floor ( Math . min ( width - GRID_PADDING - TOOLBAR_WIDTH , MAX_GRID_WIDTH ) / itemWidth ) ; } ;