<commit_before>import cx from 'classnames';
import React from 'react';
import { DragSource } from 'react-dnd';
import { MEDIA } from '../../constants/DDItemTypes';
import formatDuration from '../../utils/formatDuration';
import MediaLoadingIndicator from '../MediaLoadingIndicator';
import Actions from './Actions';

const mediaSource = {
  beginDrag(props) {
    return {
      // fall back to the row's media item if nothing is selected, i.e. if the
      // user drags a single row without selecting other rows first
      // TODO perhaps also fall back to the current row's media item if the
      // current row is not selected?
      media: props.selection || [ props.media ]
    };
  }
};

const collect = (connect, monitor) => ({
  connectDragSource: connect.dragSource(),
  isDragging: monitor.isDragging()
});

@DragSource(MEDIA, mediaSource, collect)<commit_msg>playlists: fix typo in c94c778<commit_after>import cx from 'classnames';
import React from 'react';
import { DragSource } from 'react-dnd';
import { MEDIA } from '../../constants/DDItemTypes';
import formatDuration from '../../utils/formatDuration';
import MediaLoadingIndicator from './MediaLoadingIndicator';
import Actions from './Actions';

const mediaSource = {
  beginDrag(props) {
    return {
      // fall back to the row's media item if nothing is selected, i.e. if the
      // user drags a single row without selecting other rows first
      // TODO perhaps also fall back to the current row's media item if the
      // current row is not selected?
      media: props.selection || [ props.media ]
    };
  }
};

const collect = (connect, monitor) => ({
  connectDragSource: connect.dragSource(),
  isDragging: monitor.isDragging()
});

@DragSource(MEDIA, mediaSource, collect)
{'fraction_non_alphanumeric': 0.1191827468785471, 'fraction_numerical': 0.0028376844494892167, 'mean_word_length': 3.5438144329896906, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4603173', 'n_tokens_mistral': 484, 'n_tokens_neox': 481, 'n_words': 179}