import {useRef} from "react" import useResize from "../hooks/useResize" import Store, { StoreProps } from "./Store" import StoresStyle from "../assets/css/components/stores.module.css" export interface StoresProps { stores: StoreProps[], onStoreClick : (id:string) => void } function Stores(props: StoresProps): JSX.Element { const parentDiv = useRef(null); const {width : parentWidth} = useResize(parentDiv) const columnPerRow = Math.round((parentWidth - 100) / 160) const isCenteredColumns = columnPerRow < 4 return (
{props.stores?.map((details) => ( ))}
) } export default Stores