@@ -44,6 +44,7 @@ import {hasPendingExpensifyCardAction} from '@libs/CardUtils';
4444import createDynamicRoute from '@libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute' ;
4545import useIsSidebarRouteActive from '@libs/Navigation/helpers/useIsSidebarRouteActive' ;
4646import Navigation from '@libs/Navigation/Navigation' ;
47+ import { useIsAgentAccount } from '@libs/SessionUtils' ;
4748import { getFreeTrialText , hasSubscriptionRedDotError } from '@libs/SubscriptionUtils' ;
4849import type { SkeletonSpanReasonAttributes } from '@libs/telemetry/useSkeletonSpan' ;
4950import { shouldHideOldAppRedirect } from '@libs/TryNewDotUtils' ;
@@ -170,6 +171,7 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr
170171 const [ tryNewDot , tryNewDotMetadata ] = useOnyx ( ONYXKEYS . NVP_TRY_NEW_DOT ) ;
171172 const isLoadingTryNewDot = isLoadingOnyxValue ( tryNewDotMetadata ) ;
172173 const { isBetaEnabled} = usePermissions ( ) ;
174+ const isAgentAccount = useIsAgentAccount ( ) ;
173175
174176 const freeTrialText = getFreeTrialText ( currentUserPersonalDetails . accountID , translate , policies , introSelected , firstDayFreeTrial , lastDayFreeTrial ) ;
175177
@@ -261,47 +263,59 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr
261263 sentryLabel : CONST . SENTRY_LABEL . ACCOUNT . PROFILE ,
262264 action : ( ) => Navigation . navigate ( ROUTES . SETTINGS_PROFILE . getRoute ( ) ) ,
263265 } ,
264- {
265- translationKey : 'common.wallet' ,
266- icon : icons . Wallet ,
267- screenName : SCREENS . SETTINGS . WALLET . ROOT ,
268- brickRoadIndicator : walletBrickRoadIndicator ,
269- sentryLabel : CONST . SENTRY_LABEL . ACCOUNT . WALLET ,
270- action : ( ) => Navigation . navigate ( ROUTES . SETTINGS_WALLET ) ,
271- badgeText : hasActivatedWallet ? convertToDisplayString ( userWallet ?. currentBalance , CONST . CURRENCY . USD ) : undefined ,
272- } ,
266+ ...( ! isAgentAccount
267+ ? [
268+ {
269+ translationKey : 'common.wallet' as const ,
270+ icon : icons . Wallet ,
271+ screenName : SCREENS . SETTINGS . WALLET . ROOT ,
272+ brickRoadIndicator : walletBrickRoadIndicator ,
273+ sentryLabel : CONST . SENTRY_LABEL . ACCOUNT . WALLET ,
274+ action : ( ) => Navigation . navigate ( ROUTES . SETTINGS_WALLET ) ,
275+ badgeText : hasActivatedWallet ? convertToDisplayString ( userWallet ?. currentBalance , CONST . CURRENCY . USD ) : undefined ,
276+ } ,
277+ ]
278+ : [ ] ) ,
273279 {
274280 translationKey : 'expenseRulesPage.title' ,
275281 icon : icons . Bolt ,
276282 screenName : SCREENS . SETTINGS . RULES . ROOT ,
277283 sentryLabel : CONST . SENTRY_LABEL . ACCOUNT . RULES ,
278284 action : ( ) => Navigation . navigate ( ROUTES . SETTINGS_RULES ) ,
279285 } ,
280- {
281- translationKey : 'common.preferences' ,
282- icon : icons . Gear ,
283- screenName : SCREENS . SETTINGS . PREFERENCES . ROOT ,
284- sentryLabel : CONST . SENTRY_LABEL . ACCOUNT . PREFERENCES ,
285- action : ( ) => Navigation . navigate ( ROUTES . SETTINGS_PREFERENCES ) ,
286- } ,
286+ ...( ! isAgentAccount
287+ ? [
288+ {
289+ translationKey : 'common.preferences' as const ,
290+ icon : icons . Gear ,
291+ screenName : SCREENS . SETTINGS . PREFERENCES . ROOT ,
292+ sentryLabel : CONST . SENTRY_LABEL . ACCOUNT . PREFERENCES ,
293+ action : ( ) => Navigation . navigate ( ROUTES . SETTINGS_PREFERENCES ) ,
294+ } ,
295+ ]
296+ : [ ] ) ,
287297 {
288298 translationKey : 'delegate.copilot' ,
289299 icon : icons . Users ,
290300 screenName : SCREENS . SETTINGS . COPILOT ,
291301 sentryLabel : CONST . SENTRY_LABEL . ACCOUNT . COPILOT ,
292302 action : ( ) => Navigation . navigate ( ROUTES . SETTINGS_COPILOT ) ,
293303 } ,
294- {
295- translationKey : 'initialSettingsPage.security' ,
296- icon : icons . Lock ,
297- screenName : SCREENS . SETTINGS . SECURITY ,
298- brickRoadIndicator : securityBrickRoadIndicator ,
299- sentryLabel : CONST . SENTRY_LABEL . ACCOUNT . SECURITY ,
300- action : ( ) => Navigation . navigate ( ROUTES . SETTINGS_SECURITY ) ,
301- } ,
304+ ...( ! isAgentAccount
305+ ? [
306+ {
307+ translationKey : 'initialSettingsPage.security' as const ,
308+ icon : icons . Lock ,
309+ screenName : SCREENS . SETTINGS . SECURITY ,
310+ brickRoadIndicator : securityBrickRoadIndicator ,
311+ sentryLabel : CONST . SENTRY_LABEL . ACCOUNT . SECURITY ,
312+ action : ( ) => Navigation . navigate ( ROUTES . SETTINGS_SECURITY ) ,
313+ } ,
314+ ]
315+ : [ ] ) ,
302316 ] ;
303317
304- if ( isBetaEnabled ( CONST . BETAS . CUSTOM_AGENT ) ) {
318+ if ( ! isAgentAccount && isBetaEnabled ( CONST . BETAS . CUSTOM_AGENT ) ) {
305319 const rulesIndex = accountItems . findIndex ( ( item ) => item . screenName === SCREENS . SETTINGS . RULES . ROOT ) ;
306320 accountItems . splice ( rulesIndex + 1 , 0 , {
307321 translationKey : 'agentsPage.title' ,
@@ -314,7 +328,7 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr
314328 } ) ;
315329 }
316330
317- if ( subscriptionPlan || ( amountOwed ?? 0 ) > 0 ) {
331+ if ( ! isAgentAccount && ( subscriptionPlan || ( amountOwed ?? 0 ) > 0 ) ) {
318332 accountItems . splice ( 1 , 0 , {
319333 translationKey : 'allSettingsScreen.subscription' ,
320334 icon : icons . CreditCard ,
0 commit comments