import { gql } from 'graphql-request'

export const PROJECT_ACF_FRAGMENT = gql`
  fragment ProjectAcfFields on Project_Casestudyprojectcontent {
    fieldGroupName
    bodySection {
      ... on Project_Casestudyprojectcontent_BodySection_SolutionLayout {
        fieldGroupName
        solutionText
      }
      ... on Project_Casestudyprojectcontent_BodySection_3ColPhotosLayout {
        fieldGroupName
        removePadding
        photoGrid {
          fieldGroupName
          image {
            alt: altText
            imageUrl: sourceUrl
            placeholder: sourceUrl(size: THUMBNAIL)
          }
        }
      }
      ... on Project_Casestudyprojectcontent_BodySection_AsymmetricalPhotoLayout {
        fieldGroupName
        removePadding
        largeImagePlacement
        photoGrid {
          fieldGroupName
          image {
            alt: altText
            imageUrl: sourceUrl
            placeholder: sourceUrl(size: THUMBNAIL)
          }
        }
      }
      ... on Project_Casestudyprojectcontent_BodySection_FullWidthPhotoLayout {
        fieldGroupName
        removePadding
        image {
          alt: altText
          imageUrl: sourceUrl
          placeholder: sourceUrl(size: THUMBNAIL)
        }
      }
      ... on Project_Casestudyprojectcontent_BodySection_PullQuoteLayout {
        fieldGroupName
        companyName
        companyTitle
        quoteText
        fullName
      }
    }
    heroSection {
      fieldGroupName
      mainDescription
      accentColor
      customerName
      projectType
    }
    customCtaSection {
      fieldGroupName
      ctaText
      ctaLink {
        url
        title
        target
      }
    }
    productionSpecsSection {
      fieldGroupName
      specTitle
      specDescription
    }
  }
`

export const PROJECT_FRAGMENT = gql`
  ${PROJECT_ACF_FRAGMENT}
  fragment ProjectFields on Project {
    __typename
    id
    title(format: RENDERED)
    databaseId
    uri
    seo {
      fullHead
    }
    featuredImage {
      node {
        alt: altText
        imageUrl: sourceUrl
        placeholder: sourceUrl(size: THUMBNAIL)
      }
    }
    caseStudyProjectContent {
      ...ProjectAcfFields
    }
  }
`
