import { Button } from '@rocket.chat/fuselage'; import { ContextualbarTitle, ContextualbarClose, ContextualbarHeader, ContextualbarDialog, Page, PageHeader, PageContent, } from '@rocket.chat/ui-client'; import { useRoute, useRouteParameter } from '@rocket.chat/ui-contexts'; import { useCallback, useRef } from 'react'; import { useTranslation } from 'react-i18next'; import AddCustomSound from './AddCustomSound'; import CustomSoundsTable from './CustomSoundsTable'; import EditCustomSound from './EditCustomSound'; const CustomSoundsPage = () => { const { t } = useTranslation(); const id = useRouteParameter('id'); const route = useRoute('custom-sounds'); const context = useRouteParameter('context'); const reload = useRef(() => null); const handleItemClick = useCallback( (_id: string) => (): void => { route.push({ context: 'edit', id: _id, }); }, [route], ); const handleNewButtonClick = useCallback(() => { route.push({ context: 'new' }); }, [route]); const handleClose = useCallback(() => { route.push({}); }, [route]); const handleReload = useCallback(() => { reload.current(); }, []); return ( {context && ( {context === 'edit' && t('Custom_Sound_Edit')} {context === 'new' && t('Custom_Sound_Add')} {context === 'edit' && } {context === 'new' && } )} ); }; export default CustomSoundsPage;