You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AutoAssignButton.tsx 1001B

123456789101112131415161718192021222324252627282930313233
  1. import React, { useCallback } from 'react';
  2. import { useDispatch } from 'react-redux';
  3. import Button from '../../../base/ui/components/native/Button';
  4. import { BUTTON_TYPES } from '../../../base/ui/constants.native';
  5. import { autoAssignToBreakoutRooms } from '../../actions';
  6. import styles from './styles';
  7. /**
  8. * Button to auto assign participants to breakout rooms.
  9. *
  10. * @returns {JSX.Element} - The auto assign button.
  11. */
  12. const AutoAssignButton = () => {
  13. const dispatch = useDispatch();
  14. const onAutoAssign = useCallback(() => {
  15. dispatch(autoAssignToBreakoutRooms());
  16. }, [ dispatch ]);
  17. return (
  18. <Button
  19. accessibilityLabel = 'breakoutRooms.actions.autoAssign'
  20. labelKey = 'breakoutRooms.actions.autoAssign'
  21. labelStyle = { styles.autoAssignLabel }
  22. onClick = { onAutoAssign }
  23. style = { styles.autoAssignButton }
  24. type = { BUTTON_TYPES.TERTIARY } />
  25. );
  26. };
  27. export default AutoAssignButton;