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.
50 lines
880 B
50 lines
880 B
import React from 'react'
|
|
|
|
import { ProfileTypes, SportTypes } from 'config'
|
|
import { getProfileFallbackLogo, getProfileLogo } from 'helpers'
|
|
|
|
import { Image } from 'features/Common'
|
|
|
|
type ProfileImageProps = {
|
|
alt?: string,
|
|
className?: string,
|
|
id: number,
|
|
lazy?: boolean,
|
|
profileType: ProfileTypes,
|
|
size?: number,
|
|
sportType: SportTypes,
|
|
title?: string,
|
|
}
|
|
|
|
export const ProfileLogo = ({
|
|
alt,
|
|
className,
|
|
id,
|
|
lazy = false,
|
|
profileType,
|
|
size,
|
|
sportType,
|
|
title,
|
|
}: ProfileImageProps) => {
|
|
const src = getProfileLogo({
|
|
id,
|
|
profileType,
|
|
size,
|
|
sportType,
|
|
})
|
|
const fallbackSrc = getProfileFallbackLogo({
|
|
profileType,
|
|
sportType,
|
|
})
|
|
|
|
return (
|
|
<Image
|
|
alt={alt}
|
|
src={lazy ? '' : src}
|
|
data-src={lazy ? src : ''}
|
|
fallbackSrc={fallbackSrc}
|
|
className={className}
|
|
title={title}
|
|
/>
|
|
)
|
|
}
|
|
|