<commit_before>import React, { PropTypes as T } from "react";
import { Table, Grid, Segment, Icon } from "semantic-ui-react";

import { Link } from "react-router-dom";

const DirectoryListing = props => {
  const handleClick = path =>
    e => {
      if (props.onClick) {
        e.preventDefault();
        props.onClick(path);
      }
    };
  const base = props.basepath;
  return (
    <Grid>
      <Grid.Column>
        <Table basic="very" padded>
          <Table.Header>
            <Table.Row />
          </Table.Header>
          <Table.Body>
            {props.contents.filter((z) => {
               return z.name[0] !== '.';
            }).map((row, index) => {
              const fullPath = `${base}${row.path}`;

              switch (row.type) {
                case "notebook":
                  return (
                    <Table.Row key={index}>
                      <Table.Cell>
                        <a href={fullPath} onClick={handleClick(fullPath)}>
                          <Icon name="book" color="grey" />{row.name}
                        </a>
                      </Table.Cell>
                      <Table.Cell collapsing textAlign="right" />
                    </Table.Row>
                  );
                case "directory":
                  return (<commit_msg>chore(DirListing): using startsWith instead of indexed string<commit_after>import React, { PropTypes as T } from "react";
import { Table, Grid, Segment, Icon } from "semantic-ui-react";

import { Link } from "react-router-dom";

const DirectoryListing = props => {
  const handleClick = path =>
    e => {
      if (props.onClick) {
        e.preventDefault();
        props.onClick(path);
      }
    };
  const base = props.basepath;
  return (
    <Grid>
      <Grid.Column>
        <Table basic="very" padded>
          <Table.Header>
            <Table.Row />
          </Table.Header>
          <Table.Body>
            {props.contents.filter((z) => {
               return !z.name[0].startsWith('.');
            }).map((row, index) => {
              const fullPath = `${base}${row.path}`;

              switch (row.type) {
                case "notebook":
                  return (
                    <Table.Row key={index}>
                      <Table.Cell>
                        <a href={fullPath} onClick={handleClick(fullPath)}>
                          <Icon name="book" color="grey" />{row.name}
                        </a>
                      </Table.Cell>
                      <Table.Cell collapsing textAlign="right" />
                    </Table.Row>
                  );
                case "directory":
                  return (
{'fraction_non_alphanumeric': 0.13787935556388162, 'fraction_numerical': 0.0007493443237167478, 'mean_word_length': 1.3096885813148789, 'pattern_counts': {'":': 4, '<': 33, '<?xml version=': 0, '>': 43, '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': '2558481', 'n_tokens_mistral': 739, 'n_tokens_neox': 713, 'n_words': 154}