1
1
import type { ITeam } from '@rocket.chat/core-typings' ;
2
- import { Skeleton } from '@rocket.chat/fuselage' ;
3
- import { useUserId , useEndpoint , useTranslation } from '@rocket.chat/ui-contexts' ;
2
+ import { useUserId , useEndpoint } from '@rocket.chat/ui-contexts' ;
4
3
import { useQuery } from '@tanstack/react-query' ;
5
4
import type { ReactElement } from 'react' ;
6
5
import React from 'react' ;
7
6
8
- import GenericModal from '../../../../../components/GenericModal' ;
7
+ import GenericModalSkeleton from '../../../../../components/GenericModal/GenericModalSkeleton ' ;
9
8
import LeaveTeamModal from './LeaveTeamModal/LeaveTeamModal' ;
10
9
11
10
type LeaveTeamWithDataProps = {
@@ -15,7 +14,6 @@ type LeaveTeamWithDataProps = {
15
14
} ;
16
15
17
16
const LeaveTeamWithData = ( { teamId, onCancel, onConfirm } : LeaveTeamWithDataProps ) : ReactElement => {
18
- const t = useTranslation ( ) ;
19
17
const userId = useUserId ( ) ;
20
18
21
19
if ( ! userId ) {
@@ -26,11 +24,7 @@ const LeaveTeamWithData = ({ teamId, onCancel, onConfirm }: LeaveTeamWithDataPro
26
24
const { data, isLoading } = useQuery ( [ 'teams.listRoomsOfUser' ] , ( ) => getRoomsOfUser ( { teamId, userId } ) ) ;
27
25
28
26
if ( isLoading ) {
29
- return (
30
- < GenericModal variant = 'warning' onClose = { onCancel } onConfirm = { onCancel } title = { < Skeleton width = '50%' /> } confirmText = { t ( 'Cancel' ) } >
31
- < Skeleton width = 'full' />
32
- </ GenericModal >
33
- ) ;
27
+ return < GenericModalSkeleton /> ;
34
28
}
35
29
36
30
return < LeaveTeamModal onCancel = { onCancel } onConfirm = { onConfirm } rooms = { data ?. rooms || [ ] } /> ;
0 commit comments