text: /**
   * SEO component that queries for data with
   *  Gatsby's useStaticQuery React hook
   *
   * See: https://www.gatsbyjs.org/docs/use-static-query/
   */
  
  import React from 'react';
  import { useStaticQuery, graphql } from 'gatsby';
  import PropTypes from 'prop-types';
  import Helmet from 'react-helmet';
  import favicon32 from '../favicon_io/favicon-32x32.png';
  import favicon16 from '../favicon_io/favicon-16x16.png';
  import favicon512 from '../favicon_io/android-chrome-512x512.png';
  import favicon192 from '../favicon_io/android-chrome-192x192.png';
  
  
  function SEO({ description, lang, meta, title }) {
    const { site } = useStaticQuery(
      graphql`
        query {
          site {
            siteMetadata {
              title
              description
              author
              siteUrl
              twitterUsername
            }
          }
        }
      `,
    );
  
    const metaDescription = description || site.siteMetadata.description;
  
    return (
      <Helmet
        htmlAttributes={{
          lang,
        }}
        title={title}
        titleTemplate={`%s | ${site.siteMetadata.title}`}
        meta={[
          {
            name: 'description',
            content: metaDescription,
          },
          {
            property: 'og:title',
            content: 'Jonathan Helvey - Full Stack Web Developer',
          },
          {
            property: 'og:description',
            content: 'fullstack, developer',
          },
          {
            property: 'og:type',
            content: 'website',
          },
          {
            name: 'twitter:card',
            content: 'summary',
          },
          {
            name: 'twitter:creator',
            content: site.siteMetadata.twitterUsername,
          },
          {
            name: 'twitter:title',
            content: title,
          },
          {
            name: 'twitter:description',
            content: metaDescription,
          },
        ].concat(meta)}
        link={[
          {
            rel: 'icon',
            type: 'image/png',
            sizes: '16x16',
            href: `${favicon16}`,
          },
          {
            rel: 'icon',
            type: 'image/png',
            sizes: '32x32',
            href: `${favicon32}`,
          },
          {
            rel: 'icon',
            type: 'image/png',
            sizes: '32x32',
            href: `${favicon512}`,
          },
          {
            rel: 'icon',
            type: 'image/png',
            sizes: '32x32',
            href: `${favicon192}`,
          },
          { rel: 'shortcut icon', type: 'image/png', href: `${favicon32}` },
        ]}
      />
    );
  }
  
  SEO.defaultProps = {
    lang: 'en',
    meta: [],
    description: '',
  };
  
  SEO.propTypes = {
    description: PropTypes.string,
    lang: PropTypes.string,
    meta: PropTypes.arrayOf(PropTypes.object),
    title: PropTypes.string.isRequired,
  };
  
  export default SEO;
  