The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/client/views/room/Header/ParentRoomWithEndpointData.tsx

27 lines
727 B

import type { IRoom } from '@rocket.chat/core-typings';
import { HeaderTagSkeleton } from '@rocket.chat/ui-client';
import type { ReactElement } from 'react';
import React from 'react';
import { useRoomInfoEndpoint } from '../../../hooks/useRoomInfoEndpoint';
import ParentRoom from './ParentRoom';
type ParentRoomWithEndpointDataProps = {
rid: IRoom['_id'];
};
const ParentRoomWithEndpointData = ({ rid }: ParentRoomWithEndpointDataProps): ReactElement | null => {
const { data, isLoading, isError } = useRoomInfoEndpoint(rid);
if (isLoading) {
return <HeaderTagSkeleton />;
}
if (isError || !data?.room) {
return null;
}
return <ParentRoom room={data.room} />;
};
export default ParentRoomWithEndpointData;