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

import { debounce } from "lodash"
import styled from "styled-components"
import Artwork from "./artwork/grid_item"

interface Props extends RelayProps, React.HTMLProps<ArtworkGrid> {
  columnCount?: number,
  sectionMargin?: number,
  itemMargin?: number,
  onLoadMore: () => any,
}

interface State {
  loading: boolean,
}

export class ArtworkGrid extends React.Component<Props, State> {
  public static defaultProps: Partial<Props>

  componentDidMount() {
    if (this.props.onLoadMore) {
      setInterval( () => { this.maybeLoadMore() }, 150 )
    }
  }

  maybeLoadMore() {
    if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight / 2) {
      this.props.onLoadMore()
    }
  }

  sectionedArtworks() {
    const sectionedArtworks: ArtworkRelayProps[][] = []<commit_msg>Make onLoadMore optional<commit_after>import * as React from "react"
import * as Relay from "react-relay"

import { debounce } from "lodash"
import styled from "styled-components"
import Artwork from "./artwork/grid_item"

interface Props extends RelayProps, React.HTMLProps<ArtworkGrid> {
  columnCount?: number,
  sectionMargin?: number,
  itemMargin?: number,
  onLoadMore?: () => any,
}

interface State {
  loading: boolean,
}

export class ArtworkGrid extends React.Component<Props, State> {
  public static defaultProps: Partial<Props>

  componentDidMount() {
    if (this.props.onLoadMore) {
      setInterval( () => { this.maybeLoadMore() }, 150 )
    }
  }

  maybeLoadMore() {
    if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight / 2) {
      this.props.onLoadMore()
    }
  }

  sectionedArtworks() {
    const sectionedArtworks: ArtworkRelayProps[][] = []
{'fraction_non_alphanumeric': 0.12471783295711061, 'fraction_numerical': 0.004514672686230248, 'mean_word_length': 4.080229226361031, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3374650', 'n_tokens_mistral': 569, 'n_tokens_neox': 556, 'n_words': 134}