<commit_before>import React, { Component } from "react";

import classNames from 'classnames';
import uuid from 'uuid';

import Dropdown from '../Dropdown';

export default class BoardList extends Component {
    constructor({shouldPreload, boardList, provider, fetchBoardList}) {
        super()

        if (shouldPreload && !boardList) {
            fetchBoardList(provider);
        }
    }

    render() {
        const {boardList, provider, onClick} = this.props
        const classes = classNames('boardlist', `p-${provider}`)
        const hasBoards = boardList && boardList.length;

        return (
            <div className={classes}>
                {hasBoards && <Dropdown 
                    onClick={onClick} 
                    items={this.dropdownItems(boardList)} 
                />}
            </div>
        )
    }

    dropdownItems(boardList) {
        // Filter boardlist then render each board

        return boardList.filter( ({description}) => 
            description.toLowerCase()
                .includes(this.props.searchPhrase)
        ).map( 
            ({boardID, description}, index) => (
                <div 
                    key={uuid.v4()} 
                    data-value={boardID} 
                    data-index={index}
                >{description}</div>
            )
        )
    }

}

BoardList.defaultProps = {
    searchPhrase: '',
    shouldPreload: true
}<commit_msg>remove dropdown items creation in boardlist<commit_after>import React, { Component } from "react";

import classNames from 'classnames';
import uuid from 'uuid';

import Dropdown from '../Dropdown';
import Icon from '../Icon';

export default class BoardList extends Component {
    constructor({shouldPreload, boardList, provider, fetchBoardList}) {
        super()

        if (shouldPreload && !boardList) {
            fetchBoardList(provider);
        }
    }

    render() {
        const {boardList, provider, onClick, boardListElements} = this.props
        const classes = classNames('boardlist', `p-${provider}`)
        const hasBoards = boardList && boardList.length;

        return (
            <div className={classes}>
                {hasBoards && <Dropdown 
                    onClick={onClick} 
                    items={boardListElements} 
                    scrollOpts={{sliderMinHeight: 50, alwaysVisible: true}}
                />}
            </div>
        )
    }
}

BoardList.defaultProps = {
    searchPhrase: '',
    shouldPreload: true
}
{'fraction_non_alphanumeric': 0.1124, 'fraction_numerical': 0.0012, 'mean_word_length': 1.9013921113689096, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '3511807', 'n_tokens_mistral': 666, 'n_tokens_neox': 631, 'n_words': 151}