bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/presentation/download-presentation-button/component.jsx
2024-06-11 13:10:04 -03:00

42 lines
1.1 KiB
JavaScript

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 DownloadPresentationButton = ({
intl,
handleDownloadPresentation,
dark = false,
}) => (
<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;
export default injectIntl(DownloadPresentationButton);