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/client/sidebar/RoomList/Row.js

37 lines
919 B

import { SidebarSection } from '@rocket.chat/fuselage';
import React, { memo } from 'react';
import Omnichannel from '../sections/Omnichannel';
import SideBarItemTemplateWithData from './SideBarItemTemplateWithData';
const sections = {
Omnichannel,
};
const Row = ({ data, item }) => {
const { extended, t, SideBarItemTemplate, AvatarTemplate, openedRoom, sidebarViewMode } = data;
if (typeof item === 'string') {
const Section = sections[item];
return Section ? (
<Section aria-level='1' />
) : (
<SidebarSection aria-level='1'>
<SidebarSection.Title>{t(item)}</SidebarSection.Title>
</SidebarSection>
);
}
return (
<SideBarItemTemplateWithData
sidebarViewMode={sidebarViewMode}
selected={item.rid === openedRoom}
t={t}
room={item}
extended={extended}
SideBarItemTemplate={SideBarItemTemplate}
AvatarTemplate={AvatarTemplate}
/>
);
};
export default memo(Row);