text: import React from "react"
  import Layout from "../component/layout"
  import Hero from "../component/hero"
  import { graphql } from "gatsby"
  import Projects from "../component/Projects"
  import Blogs from "../component/Blogs"
  import SEO from "../component/SEO"
  
  export default function Home({ data }) {
    const {
      allStrapiProjects: { nodes: projects },
      allStrapiBlogs: { nodes: blogs },
    } = data
  
    return (
      <Layout>
        <SEO title="home" />
        <Hero />
        <Projects projects={projects} showLink title="featured projects" />
        <Blogs blogs={blogs} title="latest blog" showLink />
      </Layout>
    )
  }
  export const query = graphql`
    {
      allStrapiProjects(filter: { featured: { eq: true } }) {
        nodes {
          github
          id
          description
          title
          url
          image {
            localFile {
              childImageSharp {
                gatsbyImageData
              }
            }
          }
          stack {
            id
            title
          }
        }
      }
      allStrapiBlogs(sort: { fields: date, order: DESC }, limit: 3) {
        nodes {
          slug
          date(formatString: "MMMM Do, YYYY")
          description
          id
          title
          category
          image {
            localFile {
              childImageSharp {
                gatsbyImageData
              }
            }
          }
        }
      }
    }
  `
  