2018-06-14 16:49:28 +02:00
|
|
|
import React, {Component} from 'react';
|
|
|
|
|
import {connect} from 'react-redux';
|
|
|
|
|
import OrderDocumentsGroup from './OrderDocumentsGroup.jsx';
|
|
|
|
|
import {orderTexts} from '../../../constants/ordersConstants';
|
2018-11-05 08:48:25 +01:00
|
|
|
import WiaasBox from "../../../mainComponents/box/WiaasBox";
|
2018-06-14 16:49:28 +02:00
|
|
|
|
|
|
|
|
class OrderDocuments extends Component {
|
|
|
|
|
render() {
|
|
|
|
|
const {orderInfo} = this.props;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div id="order-documents" className="order-documents">
|
|
|
|
|
{
|
2018-10-03 16:46:41 +02:00
|
|
|
orderInfo.packages.map(orderPackage => (
|
|
|
|
|
<OrderDocumentsGroup
|
|
|
|
|
key={'order-package-' + orderPackage.id}
|
|
|
|
|
orderId={orderInfo.id}
|
|
|
|
|
documentsGroup={orderPackage}
|
|
|
|
|
/>))
|
2018-06-14 16:49:28 +02:00
|
|
|
}
|
|
|
|
|
{
|
2018-11-05 08:48:25 +01:00
|
|
|
orderInfo.documents && <div>
|
|
|
|
|
<WiaasBox mainTitle={orderTexts.labels.OTHER_DOCS}>
|
|
|
|
|
{
|
|
|
|
|
orderInfo.documents.map((document, index) => (
|
|
|
|
|
<a className="document-link-big" key={'order-document-' + index} download href={document.url}>
|
|
|
|
|
<span className="document-link">
|
|
|
|
|
<i className={`fa fa-4x fa-${document.icon}`} aria-hidden="true"></i>
|
|
|
|
|
<div>
|
|
|
|
|
{document.name}
|
|
|
|
|
</div>
|
|
|
|
|
</span>
|
|
|
|
|
</a>
|
|
|
|
|
))
|
|
|
|
|
}
|
|
|
|
|
</WiaasBox>
|
|
|
|
|
</div>
|
2018-06-14 16:49:28 +02:00
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = (state) => ({
|
|
|
|
|
orderInfo: state.processReducer.orderInfo
|
|
|
|
|
});
|
|
|
|
|
export default connect(mapStateToProps)(OrderDocuments);
|