<commit_before>import * as React from 'react';
import * as PropTypes from 'prop-types';
import clsx from 'clsx';
import IconButton from '@material-ui/core/IconButton';
import Typography from '@material-ui/core/Typography';
import createStyles from '@material-ui/styles/createStyles';
import withStyles, { WithStyles } from '@material-ui/styles/withStyles';
import { Theme } from '@material-ui/core';

export interface DayProps extends WithStyles<typeof styles> {
  children: React.ReactNode;
  current?: boolean;
  disabled?: boolean;
  hidden?: boolean;
  selected?: boolean;
}

class Day extends React.PureComponent<DayProps> {
  public static propTypes: any = {
    children: PropTypes.node.isRequired,
    classes: PropTypes.object.isRequired,
    current: PropTypes.bool,
    disabled: PropTypes.bool,
    hidden: PropTypes.bool,
    selected: PropTypes.bool,
    innerRef: PropTypes.any,
  };

  public static defaultProps = {
    disabled: false,
    hidden: false,
    current: false,
    selected: false,
  };

  public render() {
    const { children, classes, disabled, hidden, current, selected, ...other } = this.props;

    const className = clsx(classes.day, {
      [classes.hidden]: hidden,
      [classes.current]: current,
      [classes.isSelected]: selected,
      [classes.isDisabled]: disabled,
    });

    return (
      <IconButton className={className} tabIndex={hidden || disabled ? -1 : 0} {...other}>
        <Typography variant="body1" color="inherit">
          {children}
        </Typography>
      </IconButton>
    );
  }
}

export const styles = (theme: Theme) =>
  createStyles({
    day: {
      width: 36,
      height: 36,
      fontSize: theme.typography.caption.fontSize,
      margin: '0 2px',
      color: theme.palette.text.primary,
      fontWeight: theme.typography.fontWeightMedium,
      padding: 0,
    },
    hidden: {
      opacity: 0,
      pointerEvents: 'none',
    },
    current: {
      color: theme.palette.primary.main,
      fontWeight: 600,
    },
    isSelected: {
      color: theme.palette.common.white,
      backgroundColor: theme.palette.primary.main,
      fontWeight: theme.typography.fontWeightMedium,
      '&:hover': {
        backgroundColor: theme.palette.primary.main,
      },
    },
    isDisabled: {
      pointerEvents: 'none',
      color: theme.palette.text.hint,
    },
  });

export default withStyles(styles, { name: 'MuiPickersDay' })(Day as React.ComponentType<DayProps>);<commit_msg>[hooks] Refactor Day component on hooks<commit_after>import * as React from 'react';
import * as PropTypes from 'prop-types';
import clsx from 'clsx';
import IconButton from '@material-ui/core/IconButton';
import Typography from '@material-ui/core/Typography';
import { Theme, makeStyles } from '@material-ui/core';

const useStyles = makeStyles(
  (theme: Theme) => ({
    day: {
      width: 36,
      height: 36,
      fontSize: theme.typography.caption.fontSize,
      margin: '0 2px',
      color: theme.palette.text.primary,
      fontWeight: theme.typography.fontWeightMedium,
      padding: 0,
    },
    hidden: {
      opacity: 0,
      pointerEvents: 'none',
    },
    current: {
      color: theme.palette.primary.main,
      fontWeight: 600,
    },
    isSelected: {
      color: theme.palette.common.white,
      backgroundColor: theme.palette.primary.main,
      fontWeight: theme.typography.fontWeightMedium,
      '&:hover': {
        backgroundColor: theme.palette.primary.main,
      },
    },
    isDisabled: {
      pointerEvents: 'none',
      color: theme.palette.text.hint,
    },
  }),
  { name: 'MuiPickersDay' }
);

export interface DayProps {
  children: React.ReactNode;
  current?: boolean;
  disabled?: boolean;
  hidden?: boolean;
  selected?: boolean;
}

const Day: React.FC<DayProps> = ({ children, disabled, hidden, current, selected, ...other }) => {
  const classes = useStyles();
  const className = clsx(classes.day, {
    [classes.hidden]: hidden,
    [classes.current]: current,
    [classes.isSelected]: selected,
    [classes.isDisabled]: disabled,
  });

  return (
    <IconButton className={className} tabIndex={hidden || disabled ? -1 : 0} {...other}>
      <Typography variant="body2" color="inherit">
        {children}
      </Typography>
    </IconButton>
  );
};

Day.propTypes = {
  current: PropTypes.bool,
  disabled: PropTypes.bool,
  hidden: PropTypes.bool,
  selected: PropTypes.bool,
};

Day.defaultProps = {
  disabled: false,
  hidden: false,
  current: false,
  selected: false,
};

export default Day;
{'fraction_non_alphanumeric': 0.1344500771434869, 'fraction_numerical': 0.006171478950848578, 'mean_word_length': 3.1105072463768115, 'pattern_counts': {'":': 0, '<': 15, '<?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': '6254946', 'n_tokens_mistral': 1397, 'n_tokens_neox': 1390, 'n_words': 325}