2017-06-06 23:19:12 +02:00
|
|
|
import React from "react";
|
|
|
|
import { connect } from "react-redux";
|
2017-11-13 22:02:23 +01:00
|
|
|
import { makeSelectFileInfoForUri } from "redux/selectors/file_info";
|
|
|
|
import { makeSelectCostInfoForUri } from "redux/selectors/cost_info";
|
|
|
|
import { doOpenModal } from "redux/actions/app";
|
|
|
|
import { makeSelectClaimIsMine } from "redux/selectors/claims";
|
2017-06-06 23:19:12 +02:00
|
|
|
import FileActions from "./view";
|
2017-04-29 11:50:29 +02:00
|
|
|
|
2017-09-08 05:15:05 +02:00
|
|
|
const select = (state, props) => ({
|
|
|
|
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
|
|
|
|
/*availability check is disabled due to poor performance, TBD if it dies forever or requires daemon fix*/
|
|
|
|
costInfo: makeSelectCostInfoForUri(props.uri)(state),
|
|
|
|
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
|
|
|
});
|
2017-04-29 11:50:29 +02:00
|
|
|
|
2017-06-06 06:21:55 +02:00
|
|
|
const perform = dispatch => ({
|
2017-09-08 05:15:05 +02:00
|
|
|
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
2017-06-06 06:21:55 +02:00
|
|
|
});
|
2017-04-29 19:02:25 +02:00
|
|
|
|
2017-09-08 05:15:05 +02:00
|
|
|
export default connect(select, perform)(FileActions);
|