@@ -11,12 +11,10 @@ import {
1111 H3 ,
1212 palette ,
1313} from '@mongodb-js/compass-components' ;
14- import { usePreference } from 'compass-preferences-model/provider' ;
15- import { useConnectionInfo } from '@mongodb-js/compass-connections/provider' ;
16-
1714import { AiImageBanner } from './ai-image-banner' ;
1815import { closeOptInModal , optIn } from '../store/atlas-optin-reducer' ;
1916import type { RootState } from '../store/atlas-ai-store' ;
17+ import { usePreference } from 'compass-preferences-model/provider' ;
2018
2119const GEN_AI_FAQ_LINK = 'https://www.mongodb.com/docs/generative-ai-faq/' ;
2220
@@ -25,6 +23,7 @@ type OptInModalProps = {
2523 isOptInInProgress : boolean ;
2624 onOptInModalClose : ( ) => void ;
2725 onOptInClick : ( ) => void ;
26+ projectId ?: string ;
2827} ;
2928
3029const titleStyles = css ( {
@@ -77,15 +76,11 @@ export const AIOptInModal: React.FunctionComponent<OptInModalProps> = ({
7776 isOptInInProgress,
7877 onOptInModalClose,
7978 onOptInClick,
79+ projectId,
8080} ) => {
81- const connectionInfo = useConnectionInfo ( ) ;
82- const { atlasMetadata } = connectionInfo ;
8381 const isProjectAIEnabled = usePreference ( 'enableGenAIFeaturesAtlasProject' ) ;
84- const PROJECT_SETTINGS_LINK = atlasMetadata ?. projectId
85- ? window . location . origin +
86- '/v2/' +
87- atlasMetadata . projectId +
88- '#/settings/groupSettings'
82+ const PROJECT_SETTINGS_LINK = projectId
83+ ? window . location . origin + '/v2/' + projectId + '#/settings/groupSettings'
8984 : null ;
9085
9186 const onConfirmClick = ( ) => {
0 commit comments