You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
spa_instat_tv/src/components/Ads/index.tsx

31 lines
666 B

import type { AdType } from 'requests'
import { isMobileDevice } from 'config'
import {
HeaderWrapAd,
} from './styled'
import { AdComponent } from './components/AdComponent'
import { AdsPropsType } from './types'
import { MobileAd } from './components/MobileAd'
export const HeaderAds = ({ ads }: AdsPropsType) => (
ads?.length ? (
<HeaderWrapAd column={ads?.length}>
{ads.map((ad: AdType) => (
!isMobileDevice ? (
<AdComponent
ad={ad}
key={ad.id}
/>
) : (
<MobileAd
ad={ad}
key={ad.id}
/>
)
))}
</HeaderWrapAd>
) : null
)