import React from 'react'; import '../css/AssetDownloadButtons.scss'; import AssetDownloads from '../classes/AssetDownloads'; import PropTypes from 'prop-types'; import ExportAssetDialog from './ExportAssetDialog'; import { _ } from '../classes/gettext'; class AssetDownloadButtons extends React.Component { static defaultProps = { disabled: false, direction: "down", // or "up", buttonClass: "btn-primary", task: null, showLabel: true }; static propTypes = { disabled: PropTypes.bool, task: PropTypes.object.isRequired, direction: PropTypes.string, buttonClass: PropTypes.string, showLabel: PropTypes.bool }; constructor(props){ super(); this.state = { exportDialogProps: null } } onHide = () => { this.setState({exportDialogProps: null}); } render(){ const assetDownloads = AssetDownloads.only(this.props.task.available_assets); return (
{this.state.exportDialogProps ? : ""} {this.props.showLabel ? : ""}
); } } export default AssetDownloadButtons;