2017-09-17 22:33:52 +02:00
|
|
|
import React from "react";
|
|
|
|
import { connect } from "react-redux";
|
|
|
|
import {
|
|
|
|
makeSelectClaimForUri,
|
|
|
|
makeSelectContentTypeForUri,
|
|
|
|
makeSelectMetadataForUri,
|
2017-11-13 22:02:23 +01:00
|
|
|
} from "redux/selectors/claims";
|
2017-09-17 22:33:52 +02:00
|
|
|
import FileDetails from "./view";
|
2017-11-13 22:02:23 +01:00
|
|
|
import { doOpenFileInFolder } from "redux/actions/file_info";
|
|
|
|
import { makeSelectFileInfoForUri } from "redux/selectors/file_info";
|
2017-09-17 22:33:52 +02:00
|
|
|
|
|
|
|
const select = (state, props) => ({
|
|
|
|
claim: makeSelectClaimForUri(props.uri)(state),
|
|
|
|
contentType: makeSelectContentTypeForUri(props.uri)(state),
|
2017-09-20 14:47:08 +02:00
|
|
|
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
|
2017-09-17 22:33:52 +02:00
|
|
|
metadata: makeSelectMetadataForUri(props.uri)(state),
|
|
|
|
});
|
|
|
|
|
2017-09-20 14:47:08 +02:00
|
|
|
const perform = dispatch => ({
|
|
|
|
openFolder: path => dispatch(doOpenFileInFolder(path)),
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(FileDetails);
|