bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/nav-bar/leave-meeting-button/component.jsx
2023-11-20 13:30:07 -03:00

35 lines
833 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import Styled from './styles';
import { makeCall } from '/imports/ui/services/api';
// Set the logout code to 680 because it's not a real code and can be matched on the other side
const LOGOUT_CODE = '680';
const propTypes = {
label: PropTypes.string.isRequired,
};
const LeaveMeetingButton = ({ label }) => {
const leaveSession = () => {
makeCall('userLeftMeeting');
// we don't check askForFeedbackOnLogout here,
// it is checked in meeting-ended component
Session.set('codeError', LOGOUT_CODE);
};
return (
<Styled.LeaveButton
label={label}
color="danger"
size="lg"
onClick={() => leaveSession()}
icon="logout"
/>
);
};
LeaveMeetingButton.propTypes = propTypes;
export default LeaveMeetingButton;