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

27 lines
516 B
React
Raw Normal View History

2021-08-06 04:03:43 +08:00
import React from 'react';
import _ from 'lodash';
2021-10-26 22:48:18 +08:00
import Styled from './styles';
2021-08-06 04:03:43 +08:00
const DEBOUNCE_TIMEOUT = 5000;
const DEBOUNCE_OPTIONS = {
leading: true,
trailing: false,
};
const ReloadButtonComponent = ({
handleReload,
label,
}) => (
2021-10-26 22:48:18 +08:00
<Styled.Wrapper>
<Styled.ReloadButton
2021-08-06 04:03:43 +08:00
color="primary"
icon="refresh"
onClick={_.debounce(handleReload, DEBOUNCE_TIMEOUT, DEBOUNCE_OPTIONS)}
label={label}
hideLabel
/>
2021-10-26 22:48:18 +08:00
</Styled.Wrapper>
2021-08-06 04:03:43 +08:00
);
export default ReloadButtonComponent;