1 import React, { useCallback } from 'react'; 2 import { useTranslation } from 'react-i18next'; 3 import { useDispatch } from 'react-redux'; 4 import { makeStyles } from 'tss-react/mui'; 5 6 import Button from '../../../../../base/ui/components/web/Button'; 7 import { BUTTON_TYPES } from '../../../../../base/ui/constants.web'; 8 import { createBreakoutRoom } from '../../../../../breakout-rooms/actions'; 9 10 const useStyles = makeStyles()(theme => { 11 return { 12 button: { 13 marginTop: theme.spacing(3) 14 } 15 }; 16 }); 17 18 export const AddBreakoutRoomButton = () => { 19 const { classes } = useStyles(); 20 const { t } = useTranslation(); 21 const dispatch = useDispatch(); 22 23 const onAdd = useCallback(() => 24 dispatch(createBreakoutRoom()) 25 , [ dispatch ]); 26 27 return ( 28 <Button 29 accessibilityLabel = { t('breakoutRooms.actions.add') } 30 className = { classes.button } 31 fullWidth = { true } 32 labelKey = { 'breakoutRooms.actions.add' } 33 onClick = { onAdd } 34 type = { BUTTON_TYPES.SECONDARY } /> 35 ); 36 };