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/settings/groups/BaseGroupPage.tsx

27 lines
975 B

import type { ReactElement } from 'react';
import GenericGroupPage from './GenericGroupPage';
import TabbedGroupPage from './TabbedGroupPage';
import { useEditableSettingsGroupSections, useEditableSettingsGroupTabs } from '../../EditableSettingsContext';
type BaseGroupPageProps = {
_id: string;
i18nLabel: string;
headerButtons?: ReactElement;
hasReset?: boolean;
onClickBack?: () => void;
};
const BaseGroupPage = ({ _id, i18nLabel, headerButtons, hasReset, onClickBack, ...props }: BaseGroupPageProps) => {
const tabs = useEditableSettingsGroupTabs(_id);
const sections = useEditableSettingsGroupSections(_id);
if (tabs.length > 1) {
return (
<TabbedGroupPage _id={_id} i18nLabel={i18nLabel} headerButtons={headerButtons} tabs={tabs} onClickBack={onClickBack} {...props} />
);
}
return <GenericGroupPage _id={_id} i18nLabel={i18nLabel} sections={sections} onClickBack={onClickBack} hasReset={hasReset} {...props} />;
};
export default BaseGroupPage;