<commit_before>import * as React from "react"
import * as Relay from "react-relay"
import styled from "styled-components"

import Artwork from "../../../../components/artwork"
import Button from "../../../../components/buttons/inverted"
import Nav from "../../../../components/nav"
import NavItem from "../../../../components/nav_item"
import TextArea from "../../../../components/text_area"
import Title from "../../../../components/title"

const InquiryContainer = styled.div`
  display: inline-block;
`

const Container = styled.div`
  text-align: center;

  & .footer {
    max-width: 500;
    margin: 10px auto;
  }
`

class Inquiries extends React.Component<RelayProps, any> {
  renderArtworks() {
    if (!this.props.user) {
      return []
    }

    const edges = this.props.user.artwork_inquiries_connection.edges || []
    return edges.map(edge => {
      const artwork: any = edge.node
      return (
        <InquiryContainer>
          <Artwork key={artwork.__id} artwork={artwork} />
        </InquiryContainer>
      )
    })
  }

  render() {
    return (
      <Container>
        <Nav>
          <NavItem href="https://www.artsy.net">Back To Artsy</NavItem>
        </Nav>
        <Title>Please select all works your purchased</Title>
        <div className="artworks">
          {this.renderArtworks()}
        </div>
        <footer className="footer">
          <Title titleSize="small">If you purchased any works not listed above, please list them.</Title>
          <TextArea block placeholder="Artwork, Artist, Gallery" />
          <Button block>Submit purchases</Button>
        </footer>
      </Container>
    )
  }
}

export default Relay.createContainer(Inquiries, {
  fragments: {
    user: () => Relay.QL`
      fragment on Me {
        artwork_inquiries_connection(first: 10) {
          edges {
            node {
              id
              artwork {
                ${(Artwork.getFragment("artwork"))}
              }
            }
          }<commit_msg>[Loyalty] fixes bug with Artwork<commit_after>import * as React from "react"
import * as Relay from "react-relay"
import styled from "styled-components"

import Artwork from "../../../../components/artwork"
import Button from "../../../../components/buttons/inverted"
import Nav from "../../../../components/nav"
import NavItem from "../../../../components/nav_item"
import TextArea from "../../../../components/text_area"
import Title from "../../../../components/title"

const InquiryContainer = styled.div`
  display: inline-block;
`

const Container = styled.div`
  text-align: center;

  & .footer {
    max-width: 500;
    margin: 10px auto;
  }
`

class Inquiries extends React.Component<any, any> {
  renderArtworks() {
    if (!this.props.user) {
      return []
    }

    const edges = this.props.user.artwork_inquiries_connection.edges || []
    return edges.map(edge => {
      const artwork = edge.node.artwork
      return (
        <InquiryContainer>
          <Artwork key={artwork.id} artwork={artwork} />
        </InquiryContainer>
      )
    })
  }

  render() {
    return (
      <Container>
        <Nav>
          <NavItem href="https://www.artsy.net">Back To Artsy</NavItem>
        </Nav>
        <Title>Please select all works your purchased</Title>
        <div className="artworks">
          {this.renderArtworks()}
        </div>
        <footer className="footer">
          <Title titleSize="small">If you purchased any works not listed above, please list them.</Title>
          <TextArea block placeholder="Artwork, Artist, Gallery" />
          <Button block>Submit purchases</Button>
        </footer>
      </Container>
    )
  }
}

export default Relay.createContainer(Inquiries, {
  fragments: {
    user: () => Relay.QL`
      fragment on Me {
        artwork_inquiries_connection(first: 10) {
          edges {
            node {
              id
              artwork {
                ${Artwork.getFragment("artwork")}
              }
            }
          }
{'fraction_non_alphanumeric': 0.1469632591852037, 'fraction_numerical': 0.0034991252186953262, 'mean_word_length': 2.0855821125674634, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 49, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1782206', 'n_tokens_mistral': 1149, 'n_tokens_neox': 1139, 'n_words': 277}