diff --git a/src/components/ConnectToNetSuiteButton/index.tsx b/src/components/ConnectToNetSuiteButton/index.tsx index bf314860a061..e69de29bb2d1 100644 --- a/src/components/ConnectToNetSuiteButton/index.tsx +++ b/src/components/ConnectToNetSuiteButton/index.tsx @@ -1,135 +0,0 @@ -import React, {useRef, useState} from 'react'; -import type {View} from 'react-native'; -import AccountingConnectionConfirmationModal from '@components/AccountingConnectionConfirmationModal'; -import Button from '@components/Button'; -import * as Expensicons from '@components/Icon/Expensicons'; -import PopoverMenu from '@components/PopoverMenu'; -import useLocalize from '@hooks/useLocalize'; -import useNetwork from '@hooks/useNetwork'; -import usePolicy from '@hooks/usePolicy'; -import useThemeStyles from '@hooks/useThemeStyles'; -import useWindowDimensions from '@hooks/useWindowDimensions'; -import {removePolicyConnection} from '@libs/actions/connections'; -import {getAdminPoliciesConnectedToNetSuite} from '@libs/actions/Policy/Policy'; -import Navigation from '@libs/Navigation/Navigation'; -import {isControlPolicy} from '@libs/PolicyUtils'; -import type {AnchorPosition} from '@styles/index'; -import CONST from '@src/CONST'; -import ROUTES from '@src/ROUTES'; -import type {ConnectToNetSuiteButtonProps} from './types'; - -function ConnectToNetSuiteButton({policyID, shouldDisconnectIntegrationBeforeConnecting, integrationToDisconnect}: ConnectToNetSuiteButtonProps) { - const styles = useThemeStyles(); - const {translate} = useLocalize(); - const {isOffline} = useNetwork(); - const policy = usePolicy(policyID); - - const [isDisconnectModalOpen, setIsDisconnectModalOpen] = useState(false); - - const hasPoliciesConnectedToNetSuite = !!getAdminPoliciesConnectedToNetSuite()?.length; - const {isSmallScreenWidth} = useWindowDimensions(); - const [isReuseConnectionsPopoverOpen, setIsReuseConnectionsPopoverOpen] = useState(false); - const [reuseConnectionPopoverPosition, setReuseConnectionPopoverPosition] = useState({horizontal: 0, vertical: 0}); - const threeDotsMenuContainerRef = useRef(null); - const connectionOptions = [ - { - icon: Expensicons.LinkCopy, - text: translate('workspace.common.createNewConnection'), - onSelected: () => { - Navigation.navigate(ROUTES.POLICY_ACCOUNTING_NETSUITE_TOKEN_INPUT.getRoute(policyID)); - setIsReuseConnectionsPopoverOpen(false); - }, - }, - { - icon: Expensicons.Copy, - text: translate('workspace.common.reuseExistingConnection'), - onSelected: () => { - Navigation.navigate(ROUTES.POLICY_ACCOUNTING_NETSUITE_EXISTING_CONNECTIONS.getRoute(policyID)); - setIsReuseConnectionsPopoverOpen(false); - }, - }, - ]; - - return ( - <> -