bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/reload-button/component.jsx
2021-08-05 17:03:43 -03:00

30 lines
602 B
JavaScript
Executable File

import React from 'react';
import Button from '/imports/ui/components/button/component';
import _ from 'lodash';
import { styles } from './styles';
const DEBOUNCE_TIMEOUT = 5000;
const DEBOUNCE_OPTIONS = {
leading: true,
trailing: false,
};
const ReloadButtonComponent = ({
handleReload,
label,
}) => (
<div className={styles.button}>
<Button
color="primary"
icon="refresh"
size="md"
circle
onClick={_.debounce(handleReload, DEBOUNCE_TIMEOUT, DEBOUNCE_OPTIONS)}
label={label}
hideLabel
/>
</div>
);
export default ReloadButtonComponent;