2018-01-31 02:15:23 +01:00
|
|
|
import React from 'react';
|
2018-02-07 20:30:39 +01:00
|
|
|
import ErrorPage from 'components/ErrorPage';
|
2018-02-02 20:10:58 +01:00
|
|
|
import ShowAssetLite from 'components/ShowAssetLite';
|
|
|
|
import ShowAssetDetails from 'components/ShowAssetDetails';
|
2018-01-31 02:15:23 +01:00
|
|
|
|
|
|
|
class ShowAsset extends React.Component {
|
|
|
|
componentDidMount () {
|
2018-02-14 00:53:27 +01:00
|
|
|
const { asset, requestId, requestName, requestModifier } = this.props;
|
2018-02-14 18:19:22 +01:00
|
|
|
if (!asset) {
|
|
|
|
return this.props.onNewAssetRequest(requestId, requestName, requestModifier);
|
2018-02-13 03:18:56 +01:00
|
|
|
};
|
2018-01-31 02:15:23 +01:00
|
|
|
}
|
|
|
|
render () {
|
2018-02-13 03:18:56 +01:00
|
|
|
const {asset, requestExtension} = this.props;
|
|
|
|
if (asset) {
|
2018-02-14 18:19:22 +01:00
|
|
|
return requestExtension ? <ShowAssetLite/> : <ShowAssetDetails/>;
|
|
|
|
};
|
2018-01-31 02:15:23 +01:00
|
|
|
return (
|
2018-02-13 03:18:56 +01:00
|
|
|
<ErrorPage error={'loading asset data...'}/>
|
2018-01-31 02:15:23 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ShowAsset;
|