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/admin/sidebar/AdminSidebarPages.tsx

28 lines
1.1 KiB

import { Box } from '@rocket.chat/fuselage';
import type { FC } from 'react';
import React, { memo } from 'react';
import { useSyncExternalStore } from 'use-sync-external-store/shim';
import SidebarItemsAssembler from '../../../components/Sidebar/SidebarItemsAssembler';
import { useUpgradeTabParams } from '../../hooks/useUpgradeTabParams';
import { subscribeToAdminSidebarItems, getAdminSidebarItems } from '../sidebarItems';
import UpgradeTab from './UpgradeTab';
type AdminSidebarPagesProps = {
currentPath: string;
};
const AdminSidebarPages: FC<AdminSidebarPagesProps> = ({ currentPath }) => {
const items = useSyncExternalStore(subscribeToAdminSidebarItems, getAdminSidebarItems);
const { tabType, trialEndDate, isLoading } = useUpgradeTabParams();
return (
<Box display='flex' flexDirection='column' flexShrink={0} pb='x8'>
{!isLoading && tabType && <UpgradeTab type={tabType} currentPath={currentPath} trialEndDate={trialEndDate} />}
<SidebarItemsAssembler items={items} currentPath={currentPath} />
</Box>
);
};
export default memo(AdminSidebarPages);