import { gql } from 'graphql-request'

export const HOMEPAGE_FRAGMENT = gql`
  fragment HomePageFragment on Page {
    seo {
      fullHead
    }
    featuredImage {
      node {
        imageUrl: sourceUrl
        alt: altText
        placeholder: sourceUrl(size: THUMBNAIL)
      }
    }
    homepageContent {
      mainHeroSection {
        fieldGroupName
        heroTitle
        heroText
        subHeroTitle
        subHeroText
      }
      packagingSolutionsSection {
        fieldGroupName
        sectionTitle
        descriptionText
        exploreButtonLink {
          ... on Page {
            uri
          }
        }
        sliderContent {
          slideLink {
            title
            url
          }
          sliderImage {
            alt: altText
            imageUrl: sourceUrl
            placeholder: sourceUrl(size: THUMBNAIL)
          }
        }
      }
      presentationMaterialsSection {
        fieldGroupName
        sectionTitle
        descriptionText
        exploreButtonLink {
          ... on Page {
            uri
          }
        }
        sliderContent {
          slideLink {
            title
            url
          }
          sliderImage {
            alt: altText
            imageUrl: sourceUrl
            placeholder: sourceUrl(size: THUMBNAIL)
          }
        }
      }
      architechuralSampleKitSection {
        fieldGroupName
        sectionTitle
        descriptionText
        exploreButtonLink {
          ... on Page {
            uri
          }
        }
        sliderContent {
          slideLink {
            title
            url
          }
          sliderImage {
            alt: altText
            imageUrl: sourceUrl
            placeholder: sourceUrl(size: THUMBNAIL)
          }
        }
      }
      secondHeroSection {
        fieldGroupName
        secondHeroTitle
        subHeroSubTitle
        bgImage {
          alt: altText
          imageUrl: sourceUrl
          placeholder: sourceUrl(size: THUMBNAIL)
        }
      }
      threeColumnSection {
        columns {
          columnTitle
          columnDescriptionText
          buttonLink {
            target
            url
            title
          }
        }
      }
      workingTogetherSection {
        fieldGroupName
        description
        learnMoreButton {
          target
          url
        }
      }
      thirdHeroSection {
        fieldGroupName
        thirdHeroTitle
        thirdHeroSubTitle
        bgImage {
          alt: altText
          imageUrl: sourceUrl
          placeholder: sourceUrl(size: THUMBNAIL)
        }
      }
      recentCollabSection {
        fieldGroupName
        sectionTitle
        galleryButtonLink {
          ... on Page {
            uri
          }
        }
        collabSlider {
          projectSlide {
            ... on Project {
              uri
              caseStudyProjectContent {
                heroSection {
                  customerName
                }
              }
              featuredImage {
                node {
                  alt: altText
                  imageUrl: sourceUrl
                  placeholder: sourceUrl(size: THUMBNAIL)
                }
              }
              productTypes(first: 1) {
                nodes {
                  name
                }
              }
            }
          }
        }
      }
      trustedPartnerSection: imageGridSection {
        sectionTitle
        fieldGroupName
        descriptionText
        logos {
          logoImage {
            alt: altText
            imageUrl: sourceUrl
            placeholder: sourceUrl(size: THUMBNAIL)
          }
          logoImageTwo {
            alt: altText
            imageUrl: sourceUrl
            placeholder: sourceUrl(size: THUMBNAIL)
          }
        }
      }
      pullQuoteSection {
        fieldGroupName
        enablePullquote
        quoteText
        quoteName
        quoteTitle
        quoteCompany
        enableQuoteButton
        buttonLink {
          title
          url
        }
      }
      featuredCaseStudySection {
        enableFeaturedCaseStudy
        caseStudyLogo {
          alt: altText
          imageUrl: sourceUrl
          placeholder: sourceUrl(size: THUMBNAIL)
        }
        introCopy
        featuredCaseStudy {
          ... on CaseStudy {
            featuredImage {
              node {
                alt: altText
                imageUrl: sourceUrl
                placeholder: sourceUrl(size: THUMBNAIL)
              }
            }
            uri
          }
        }
      }
    }
    customResourcesSection {
      resourcesSection {
        sectionDescription
        sectionTitle
        resources {
          resourceLink {
            title
            url
          }
        }
      }
    }
    customCtaSection {
      ctaText
      ctaLink {
        title
        url
      }
      enableCta
    }
    customResourcesSection {
      resourcesSection {
        fieldGroupName
        sectionDescription
        sectionTitle
      }
    }
  }
`
