Skip to content

Commit ef8c7b1

Browse files
add ContextualbarEmptyContent for not found scenarios
1 parent 947ead4 commit ef8c7b1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/meteor/client/views/admin/customSounds/EditCustomSound.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import { ContextualbarEmptyContent } from '@rocket.chat/ui-client';
12
import { useEndpoint } from '@rocket.chat/ui-contexts';
23
import { useQuery } from '@tanstack/react-query';
34
import type { ReactElement } from 'react';
5+
import { useTranslation } from 'react-i18next';
46

57
import EditSound from './EditSound';
68
import { FormSkeleton } from '../../../components/Skeleton';
@@ -13,20 +15,20 @@ type EditCustomSoundProps = {
1315

1416
function EditCustomSound({ _id, onChange, close, ...props }: EditCustomSoundProps): ReactElement | null {
1517
const getSound = useEndpoint('GET', '/v1/custom-sounds.getOne');
18+
const { t } = useTranslation();
1619

1720
const { data, isPending } = useQuery({
1821
queryKey: ['custom-sound', _id],
1922
queryFn: () => getSound({ _id: _id! }),
2023
enabled: !!_id,
21-
meta: { apiErrorToastMessage: true },
2224
});
2325

2426
if (isPending) {
2527
return <FormSkeleton pi={20} />;
2628
}
2729

2830
if (!data) {
29-
return null;
31+
return <ContextualbarEmptyContent icon='warning' title={t('Call_info_could_not_be_loaded')} />;
3032
}
3133

3234
const handleChange: () => void = () => {

0 commit comments

Comments
 (0)