import React from 'react'; import { CardContent, CardMedia, Chip, Typography } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; import { useTranslation } from 'react-i18next'; import { FormattedProfile, FormattedMatch } from '../../../../../../typings/match'; const useStyles = makeStyles({ root: {}, tags: { position: 'absolute', bottom: '40%', }, tag: { margin: '3px 3px 0px 0px', opacity: '0.8', }, media: { height: '60%', }, content: { height: '40%', overflowY: 'auto', }, }); interface IProps { profile: FormattedProfile | FormattedMatch; } const DEFAULT_IMAGE = 'https://upload.wikimedia.org/wikipedia/commons/a/ac/No_image_available.svg'; const Profile = ({ profile }: IProps) => { const c = useStyles(); const { t } = useTranslation(); function parseSecondaryBio(): string | undefined { const { location, job } = profile; if (location && job) { return `${location} - ${job}`; } else if (location) { return location; } else if (job) { return job; } } const bioSecondary = parseSecondaryBio(); return ( <> {profile.tagList.map((tag) => ( ))} {profile.name} {t('APPS_MATCH_PROFILE_LAST_ACTIVE', { lastActive: profile.lastActiveFormatted })} {bioSecondary && ( {bioSecondary} )} {profile.bio} ); }; export default Profile;