bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/presentation/download-presentation-button/component.jsx

47 lines
1.2 KiB
React
Raw Normal View History

import React from 'react';
import { defineMessages, injectIntl } from 'react-intl';
import PropTypes from 'prop-types';
import Styled from './styles';
const intlMessages = defineMessages({
downloadPresentationButton: {
id: 'app.downloadPresentationButton.label',
description: 'Download presentation label',
},
});
const propTypes = {
intl: PropTypes.shape({
formatMessage: PropTypes.func.isRequired,
}).isRequired,
handleDownloadPresentation: PropTypes.func.isRequired,
dark: PropTypes.bool,
};
const defaultProps = {
dark: false,
};
const DownloadPresentationButton = ({
intl,
handleDownloadPresentation,
dark,
}) => (
<Styled.ButtonWrapper theme={dark ? 'dark' : 'light'}>
<Styled.DownloadButton
data-test="presentationDownload"
color="default"
icon="template_download"
size="sm"
onClick={handleDownloadPresentation}
label={intl.formatMessage(intlMessages.downloadPresentationButton)}
hideLabel
/>
</Styled.ButtonWrapper>
);
DownloadPresentationButton.propTypes = propTypes;
DownloadPresentationButton.defaultProps = defaultProps;
export default injectIntl(DownloadPresentationButton);