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

30 lines
602 B
React
Raw Normal View History

2021-08-06 04:03:43 +08:00
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;