Advertisement
petrikjosef

Untitled

Mar 10th, 2022
1,023
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import Link from 'next/link'
  2. import styled from '@emotion/styled';
  3. import { FC } from 'react';
  4. import * as S from "./AvatarBox.styled"
  5. import Image from 'next/image'
  6. import {ImageData} from '../../../lib/types/imageData'
  7.  
  8. type Props = {
  9.     type?: string
  10.     nicename?: string
  11.     position?: string
  12.     profile_image?: ImageData
  13. }
  14.  
  15. export const AvatarBox: FC<Props> = ({ type = 'default', nicename='nicename', position='position',profile_image }) => {
  16.  
  17.  
  18.     return (
  19.        
  20.         <>
  21.    
  22.         <S.AvatarBox>
  23.  
  24.             <S.AvatarBoxImage>  
  25.                 <Image
  26.                     priority
  27.                     src={process.env.NEXT_PUBLIC_STRAPI_ROOT+profile_image.data.attributes.formats.medium.url}
  28.                     width={80}
  29.                     height={80}
  30.                     objectFit="cover"
  31.                     alt={'cover image'}
  32.                 />
  33.             </S.AvatarBoxImage>
  34.  
  35.             <S.AvatarBoxName>
  36.            
  37.                 <strong>{nicename}</strong>
  38.                 <span>{position}</span>
  39.             </S.AvatarBoxName>
  40.  
  41.         </S.AvatarBox>
  42.            
  43.         </>
  44.     );
  45. }
  46.  
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement