/** * 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 { Helmet } from 'react-helmet'; import { useStaticQuery, graphql } from 'gatsby'; interface SEOProps { description?: string; lang?: string; meta?: any[]; title?: string; titleSuffix?: string; } const SEO: React.FC = ({ description, lang = '', meta = [], title, titleSuffix, }) => { const { site } = useStaticQuery( graphql` query { site { siteMetadata { title description } } } `, ); const metaDescription = description || site.siteMetadata.description; return ( ); }; SEO.defaultProps = { lang: `en`, meta: [], description: ``, }; export default SEO;