<commit_before>import React, { useState } from 'react'
import { useDispatch, useGlobalState } from '../StateProvider'
import { useEffect, useMemo } from 'react'
import LoadbalancerItem from './LoadbalancerItem';
import ErrorPage from '../ErrorPage';
import {DefeatableLink} from 'lib/components/defeatable_link';
import { SearchField } from 'lib/components/search_field';
import { CSSTransition, TransitionGroup } from 'react-transition-group';
import { Link } from 'react-router-dom';
import useLoadbalancer from '../../../lib/hooks/useLoadbalancer'
import { Tooltip, OverlayTrigger, ToggleButton, ToggleButtonGroup, ButtonToolbar } from 'react-bootstrap';
import Pagination from '../shared/Pagination'

const TableFadeTransition = ({
  children,
  ...props
}) => (<CSSTransition {...props} timeout={200} unmountOnExit classNames="css-transition-fade">
  {children}
</CSSTransition>);


const LoadbalancerList = (props) => {
  const dispatch = useDispatch()
  const state = useGlobalState().loadbalancers
  const {fetchLoadbalancers} = useLoadbalancer()


  useEffect(() => {
    console.log('FETCH initial loadbalancers')
    fetchLoadbalancers({marker: state.marker})
  }, []);

  const loadNext = event => {
    if(!state.isLoading && state.hasNext) {
      fetchLoadbalancers({marker: state.marker})
    }
  }

  const handlePaginateClick = (e,page) => {
    e.preventDefault()
    if (page === "all") {
      fetchLoadbalancers({limit: 9999});
    } else {
      fetchLoadbalancers({marker: state.marker});
    }
  };

  const search = (term) => {
    if(hasNext && !isLoading) {
      fetchLoadbalancers({limit: 9999});
    }
    dispatch({type: 'SET_LOADBALANCER_SEARCH_TERM', searchTerm: term})
  }

    
  const error = state.error
  const isLoading = state.isLoading
  const hasNext = state.hasNext
  const searchTerm = state.searchTerm<commit_msg>[lbaas2]: clean up loadbalancers<commit_after>import React, { useState } from 'react'
import { useDispatch, useGlobalState } from '../StateProvider'
import { useEffect, useMemo } from 'react'
import LoadbalancerItem from './LoadbalancerItem';
import ErrorPage from '../ErrorPage';
import {DefeatableLink} from 'lib/components/defeatable_link';
import { SearchField } from 'lib/components/search_field';
import { CSSTransition, TransitionGroup } from 'react-transition-group';
import { Link } from 'react-router-dom';
import useLoadbalancer from '../../../lib/hooks/useLoadbalancer'
import { Tooltip, OverlayTrigger, ToggleButton, ToggleButtonGroup, ButtonToolbar } from 'react-bootstrap';
import Pagination from '../shared/Pagination'

const TableFadeTransition = ({
  children,
  ...props
}) => (<CSSTransition {...props} timeout={200} unmountOnExit classNames="css-transition-fade">
  {children}
</CSSTransition>);


const LoadbalancerList = (props) => {
  const dispatch = useDispatch()
  const state = useGlobalState().loadbalancers
  const {fetchLoadbalancers} = useLoadbalancer()


  useEffect(() => {
    console.log('FETCH initial loadbalancers')
    fetchLoadbalancers({marker: state.marker})
  }, []);

  const handlePaginateClick = (e,page) => {
    e.preventDefault()
    if (page === "all") {
      fetchLoadbalancers({limit: 9999});
    } else {
      fetchLoadbalancers({marker: state.marker});
    }
  };

  const search = (term) => {
    if(hasNext && !isLoading) {
      fetchLoadbalancers({limit: 9999});
    }
    dispatch({type: 'SET_LOADBALANCER_SEARCH_TERM', searchTerm: term})
  }

    
  const error = state.error
  const isLoading = state.isLoading
  const hasNext = state.hasNext
  const searchTerm = state.searchTerm
{'fraction_non_alphanumeric': 0.13849569802941994, 'fraction_numerical': 0.006383569247849014, 'mean_word_length': 4.363095238095238, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 18, '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': '1921670', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1088, 'n_words': 249}