<commit_before>/* eslint-disable react/prop-types */
/* eslint-disable react/forbid-prop-types */
/**
 * mSupply Mobile
 * Sustainable Solutions (NZ) Ltd. 2018
 */

import React from 'react';
import PropTypes from 'prop-types';
import { View, FlatList, Text, StyleSheet } from 'react-native';

import { ReportSideBarItem } from './ReportSideBarItem';

import { DARKER_GREY, SUSSOL_ORANGE, WARMER_GREY, APP_FONT_FAMILY, GREY } from '../../globalStyles';

import { generalStrings } from '../../localization';

/**
 * This page receives all reports and renders a list of them
 * *
 * @prop  {Object}      reports         All reports available to be selected
 * @prop  {function}    currentReport   The current rendered report
 * @prop  {Object}      onPressItem     Function to be executed when an item is pressed
 * @prop  {Object}      dimensions      Width and height of the graph container
 */

export const ReportSideBar = ({ reports, currentReport, onPressItem, dimensions }) => {
  const renderItem = ({ item }) => {
    const { id, index, title, type, date } = item;
    const isSelected = id === currentReport.id;
    return (
      <ReportSideBarItem
        id={id}
        index={index}
        onPress={onPressItem}
        icon={type}
        content={title}
        subContent={date}
        iconStyle={isSelected ? localStyles.selectedIcon : localStyles.icon}
        contentStyle={isSelected ? localStyles.selectedContent : localStyles.content}
      />
    );
  };

  const renderHeader = () => (
    <View><commit_msg>Modify @props types<commit_after>/* eslint-disable react/prop-types */
/* eslint-disable react/forbid-prop-types */
/**
 * mSupply Mobile
 * Sustainable Solutions (NZ) Ltd. 2018
 */

import React from 'react';
import PropTypes from 'prop-types';
import { View, FlatList, Text, StyleSheet } from 'react-native';

import { ReportSideBarItem } from './ReportSideBarItem';

import { DARKER_GREY, SUSSOL_ORANGE, WARMER_GREY, APP_FONT_FAMILY, GREY } from '../../globalStyles';

import { generalStrings } from '../../localization';

/**
 * This page receives all reports and renders a list of them
 * *
 * @prop  {Object}      reports         All reports available to be selected
 * @prop  {Object}      currentReport   The current rendered report
 * @prop  {function}    onPressItem     Function to be executed when an item is pressed
 * @prop  {Object}      dimensions      Width and height of the graph container
 */

export const ReportSideBar = ({ reports, currentReport, onPressItem, dimensions }) => {
  const renderItem = ({ item }) => {
    const { id, index, title, type, date } = item;
    const isSelected = id === currentReport.id;
    return (
      <ReportSideBarItem
        id={id}
        index={index}
        onPress={onPressItem}
        icon={type}
        content={title}
        subContent={date}
        iconStyle={isSelected ? localStyles.selectedIcon : localStyles.icon}
        contentStyle={isSelected ? localStyles.selectedContent : localStyles.content}
      />
    );
  };

  const renderHeader = () => (
    <View>
{'fraction_non_alphanumeric': 0.11873780091086532, 'fraction_numerical': 0.002602472348731295, 'mean_word_length': 3.0513833992094863, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5384586', 'n_tokens_mistral': 896, 'n_tokens_neox': 881, 'n_words': 261}