diff --git a/packages/twenty-front/src/modules/ai/components/AiChatApiKeyNotConfiguredMessage.tsx b/packages/twenty-front/src/modules/ai/components/AiChatApiKeyNotConfiguredMessage.tsx index 3c32900ad4..488db26e0a 100644 --- a/packages/twenty-front/src/modules/ai/components/AiChatApiKeyNotConfiguredMessage.tsx +++ b/packages/twenty-front/src/modules/ai/components/AiChatApiKeyNotConfiguredMessage.tsx @@ -1,13 +1,20 @@ import { AiChatBanner } from '@/ai/components/AiChatBanner'; +import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState'; +import { getDocumentationUrl } from '@/support/utils/getDocumentationUrl'; +import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue'; import { t } from '@lingui/core/macro'; +import { DOCUMENTATION_PATHS } from 'twenty-shared/constants'; import { IconExternalLink } from 'twenty-ui/display'; -const DOCS_URL = - 'https://twenty.com/developers/section/self-hosting/self-hosting-var#ai-features'; - export const AiChatApiKeyNotConfiguredMessage = () => { + const currentWorkspaceMember = useAtomStateValue(currentWorkspaceMemberState); + const handleDocsClick = () => { - window.open(DOCS_URL, '_blank', 'noopener,noreferrer'); + const docsUrl = getDocumentationUrl({ + locale: currentWorkspaceMember?.locale, + path: DOCUMENTATION_PATHS.DEVELOPERS_SELF_HOST_CAPABILITIES_SETUP, + }); + window.open(docsUrl, '_blank', 'noopener,noreferrer'); }; return (