import * as React from "react"
import { graphql } from "gatsby"

import Advantage from "@/components/home/advantage"
import Banner from "@/components/home/banner"
import CooperativePartner from "@/components/home/cooperative-partner"
import FreeExperience from "@/components/free-experience"
import IndustryInsights from "@/components/home/industry-insights"
import JointSolution from "@/components/joint-solution/section"
import Layout from "@/components/layout"
import MoreResource from "@/components/home/more-resource"
import OurPartner from "@/components/home/our-partner"
import Seo from "@/components/seo"
import t from "@/constants/wording"
import { HOME_JOINT_SOLUTION } from "@/constants/home"
import { HomeLatestInfo, HomeTechnologyAndInnovations } from "@/components"

const IndexPage = ({ data }: any) => {
  const ourPartnerText = {
    h4Text: t("ours partners"),
    h1Text: t("tidb has now been used in actual production environments"),
    h5Text: t("PingCAP has many star customers in the financial field"),
    isShowMore: true,
    showDescription: true,
  }

  return (
    <Layout>
      <Seo
        useChineseTitle
        title={t("Home.PingCAP")}
        description={t(
          "Enter the PingCAP official website and experience the new distributed HTAP database"
        )}
        keywords={t("keywords")}
      />
      <Banner />
      <HomeLatestInfo nodes={data.allStrapiHomeLatestInformation.nodes} />
      <Advantage />
      <OurPartner textContent={ourPartnerText} />
      <HomeTechnologyAndInnovations />
      <IndustryInsights />
      <CooperativePartner />
      <JointSolution
        sectionName={HOME_JOINT_SOLUTION.sectionName}
        title={HOME_JOINT_SOLUTION.title}
      />
      <MoreResource />
      <FreeExperience />
    </Layout>
  )
}

export const query = graphql`
  query FetchHomeBanners {
    allStrapiHomeLatestInformation {
      nodes {
        icon {
          url
        }
        link
        order
        moreLink
        section
        title
        id
      }
    }
  }
`

export default IndexPage
