import React from 'react' import map from 'lodash/map' import isEmpty from 'lodash/isEmpty' import type { Match } from 'features/Matches' import { MatchCard } from 'features/MatchCard' import { useMatchesSlider } from './hooks' import { Wrapper, Arrow, Slides, } from './styled' type MatchesSliderProps = { matches: Array, } export const MatchesSlider = ({ matches }: MatchesSliderProps) => { const { onScroll, showLeftArrow, showRightArrow, slideLeft, slideRight, slidesRef, } = useMatchesSlider(matches) if (isEmpty(matches)) return null return ( {showLeftArrow && ( )} {map(matches, (match) => )} {showRightArrow && ( )} ) }