{"size": 816, "ext": "js", "max_stars_repo_path": "shared/fs/common/path-item-icon-container.js", "max_stars_repo_name": "kid1carus/client", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "shared/fs/common/path-item-icon-container.js", "max_issues_repo_name": "kid1carus/client", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "shared/fs/common/path-item-icon-container.js", "max_forks_repo_name": "kid1carus/client", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.1379310345, "max_line_length": 107, "alphanum_fraction": 0.6948529412}
// @flow
import * as Types from '../../constants/types/fs'
import * as Styles from '../../styles'
import * as Constants from '../../constants/fs'
import {namedConnect} from '../../util/container'
import PathItemIcon, {type Size} from './path-item-icon'

export type OwnProps = {
  badge?: ?Types.PathItemBadge,
  path: Types.Path,
  size: Size,
  style?: Styles.StylesCrossPlatform,
}

const mapStateToProps = (state, {path}) => ({
  _pathItem: state.fs.pathItems.get(path, Constants.unknownPathItem),
  username: state.config.username,
})

const mergeProps = (stateProps, dispatchProps, ownProps) => ({
  ...ownProps,
  type: stateProps._pathItem.type,
  username: stateProps.username,
})

export default namedConnect<OwnProps, _, _, _, _>(mapStateToProps, () => ({}), mergeProps, 'PathItemIcon')(
  PathItemIcon
)
