bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/common/control-header/component.jsx

43 lines
981 B
React
Raw Normal View History

import React from 'react';
import PropTypes from 'prop-types';
import Styled from './styles';
import Left from './left/component';
import Right from './right/component';
const Header = ({
leftButtonProps,
rightButtonProps,
customRightButton,
2022-06-08 02:52:22 +08:00
'data-test': dataTest,
}) => {
const renderCloseButton = () => (
<Right {...rightButtonProps} />
);
const renderCustomRightButton = () => (
<Styled.RightWrapper>
{customRightButton}
</Styled.RightWrapper>
);
return (
2022-06-08 02:52:22 +08:00
<Styled.Header data-test={dataTest ? dataTest : ''}>
{leftButtonProps ? <Left {...leftButtonProps} /> : <div />}
{customRightButton
? renderCustomRightButton()
: rightButtonProps
? renderCloseButton()
: null}
</Styled.Header>
);
}
Header.propTypes = {
leftButtonProps: PropTypes.object,
rightButtonProps: PropTypes.object,
customRightButton: PropTypes.element,
2022-06-08 02:52:22 +08:00
dataTest: PropTypes.string,
};
export default Header;