diff --git a/src/pages/workspace/WorkspaceMoreFeaturesPage.tsx b/src/pages/workspace/WorkspaceMoreFeaturesPage.tsx index 2c8123670e0b..c717c4a2f14e 100644 --- a/src/pages/workspace/WorkspaceMoreFeaturesPage.tsx +++ b/src/pages/workspace/WorkspaceMoreFeaturesPage.tsx @@ -8,6 +8,7 @@ import ScrollView from '@components/ScrollView'; import Section from '@components/Section'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; +import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import type {WorkspacesCentralPaneNavigatorParamList} from '@libs/Navigation/types'; @@ -43,6 +44,7 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro const styles = useThemeStyles(); const {isSmallScreenWidth} = useWindowDimensions(); const {translate} = useLocalize(); + const {canUseAccountingIntegrations} = usePermissions(); const spendItems: Item[] = [ { @@ -100,6 +102,19 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro }, ]; + const integrateItems: Item[] = [ + { + icon: Illustrations.Accounting, + titleTranslationKey: 'workspace.moreFeatures.connections.title', + subtitleTranslationKey: 'workspace.moreFeatures.connections.subtitle', + isActive: !!policy?.areConnectionsEnabled, + pendingAction: policy?.pendingFields?.areConnectionsEnabled, + action: (isEnabled: boolean) => { + Policy.enablePolicyConnections(policy?.id ?? '', isEnabled); + }, + }, + ]; + const sections: SectionObject[] = [ { titleTranslationKey: 'workspace.moreFeatures.spendSection.title', @@ -113,6 +128,14 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro }, ]; + if (canUseAccountingIntegrations) { + sections.push({ + titleTranslationKey: 'workspace.moreFeatures.integrateSection.title', + subtitleTranslationKey: 'workspace.moreFeatures.integrateSection.subtitle', + items: integrateItems, + }); + } + const renderItem = useCallback( (item: Item) => (