2021-09-14 17:31:30 +02:00
|
|
|
import React, { useCallback } from 'react';
|
|
|
|
|
import { useDispatch } from 'react-redux';
|
|
|
|
|
|
2023-10-11 17:34:49 +03:00
|
|
|
import Button from '../../../base/ui/components/native/Button';
|
|
|
|
|
import { BUTTON_TYPES } from '../../../base/ui/constants.native';
|
|
|
|
|
import { createBreakoutRoom } from '../../actions';
|
2021-09-14 17:31:30 +02:00
|
|
|
|
|
|
|
|
import styles from './styles';
|
|
|
|
|
|
2022-08-05 11:11:28 +02:00
|
|
|
/**
|
|
|
|
|
* Button to add a breakout room.
|
|
|
|
|
*
|
|
|
|
|
* @returns {JSX.Element} - The add breakout room button.
|
|
|
|
|
*/
|
2021-09-14 17:31:30 +02:00
|
|
|
const AddBreakoutRoomButton = () => {
|
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
|
|
|
|
|
|
const onAdd = useCallback(() =>
|
|
|
|
|
dispatch(createBreakoutRoom())
|
|
|
|
|
, [ dispatch ]);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Button
|
2022-07-07 15:29:18 +03:00
|
|
|
accessibilityLabel = 'breakoutRooms.actions.add'
|
2022-08-22 12:40:59 +03:00
|
|
|
labelKey = 'breakoutRooms.actions.add'
|
|
|
|
|
onClick = { onAdd }
|
2022-08-05 11:11:28 +02:00
|
|
|
style = { styles.button }
|
2022-07-07 15:29:18 +03:00
|
|
|
type = { BUTTON_TYPES.SECONDARY } />
|
2021-09-14 17:31:30 +02:00
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default AddBreakoutRoomButton;
|