import React from 'react'

type HeadshotProps = {
  headshot: string
  prefLabel: string
  streamPage?: string
  className?: string
}

const Headshot: React.FC<HeadshotProps> = ({
  headshot,
  prefLabel,
  streamPage,
  className,
}) => {
  return streamPage ? (
    <a href={streamPage} aria-label={`Author page for ${prefLabel}`}>
      <img className={className} src={headshot} role="presentation" alt="" />
    </a>
  ) : (
    <img className={className} src={headshot} role="presentation" alt="" />
  )
}

export default Headshot
