summaryrefslogtreecommitdiff
path: root/client/containers/fileLink.js
blob: cb55c1c7cb92848a16452bff7a062b8cd1da7e12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { connect } from 'react-redux'
import { audioPlayFile } from '../actions'
import Link from '../components/UI/Link.jsx'

const mapStateToProps = (state, ownProps) => ({
})

const mapDispatchToProps = (dispatch, ownProps) => ({
  onClick: () => {
    switch (ownProps.file.type) {
      case 'audio':
        dispatch(audioPlayFile(ownProps.file))
        break
    }
  }
})

const FileLink = connect(
  mapStateToProps,
  mapDispatchToProps
)(Link)

export default FileLink