import React, { Component } from 'react'; import PropTypes from 'prop-types'; import './googleCloud.css'; import { withTranslation } from 'react-i18next'; import { Icon } from 'react-viewerbase'; class DicomStoreList extends Component { state = { search: '', }; static propTypes = { stores: PropTypes.array, loading: PropTypes.bool.isRequired, error: PropTypes.string, onSelect: PropTypes.func, }; static defaultProps = { loading: true, }; renderTableRow = store => { return ( { this.onHighlightItem(store.name); }} onClick={() => { this.props.onSelect(store); }} > {store.name.split('/')[7]} ); }; onHighlightItem(store) { this.setState({ highlightedItem: store }); } render() { if (this.props.error) { return

{this.props.error}

; } const loadingIcon = ( ); if (this.props.loading) { return loadingIcon; } const body = ( {this.props.stores.map(this.renderTableRow)} ); return ( {this.props.stores && body}
{this.props.t('DICOM Store')}
); } } export default withTranslation('Common')(DicomStoreList);