import React from 'react'
import Img from 'gatsby-image'
import * as classNames from 'classnames'
let styles = require('./styles.module.scss')

interface IProps {
  alt?: string
  className?: string
  fitViewport?: boolean
  fixed: any
  style?: {}
  density?: number;
}

const FixedImage = ({
  alt,
  className,
  fixed,
  style,
}: IProps) => {
  var normalizedProps = {
    alt,
    fixed,
    style: {
      ...(style || {}),
    },
    className: classNames({
      [className]: !!className,
      [styles.image]: true,
    }),
  }

  const image = <Img {...normalizedProps} alt={alt} Tag='figure'/>

  return image
}

export default FixedImage
