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.
31 lines
671 B
31 lines
671 B
import type { AdType } from 'requests'
|
|
|
|
import { isMobileDevice } from 'config'
|
|
|
|
import type { AdsPropsType } from './types'
|
|
import { AdComponent } from './components/AdComponent'
|
|
import { MobileAd } from './components/MobileAd'
|
|
|
|
import {
|
|
HeaderWrapAd,
|
|
} from './styled'
|
|
|
|
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
|
|
)
|
|
|