From cfc3f1527abd0a716a0f000462deadf0d8e10fe2 Mon Sep 17 00:00:00 2001 From: Nite Knite Date: Tue, 21 Oct 2025 16:23:49 +0800 Subject: [PATCH] chore: switch support channels according to configuration (#27195) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../header/account-dropdown/support.tsx | 45 +++++++++++++------ 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/web/app/components/header/account-dropdown/support.tsx b/web/app/components/header/account-dropdown/support.tsx index fda45f2db5..b165c5fcca 100644 --- a/web/app/components/header/account-dropdown/support.tsx +++ b/web/app/components/header/account-dropdown/support.tsx @@ -1,5 +1,5 @@ import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react' -import { RiArrowRightSLine, RiArrowRightUpLine, RiChatSmile2Line, RiDiscordLine, RiFeedbackLine, RiQuestionLine } from '@remixicon/react' +import { RiArrowRightSLine, RiArrowRightUpLine, RiChatSmile2Line, RiDiscordLine, RiFeedbackLine, RiMailSendLine, RiQuestionLine } from '@remixicon/react' import { Fragment } from 'react' import Link from 'next/link' import { useTranslation } from 'react-i18next' @@ -7,6 +7,9 @@ import cn from '@/utils/classnames' import { useProviderContext } from '@/context/provider-context' import { Plan } from '@/app/components/billing/type' import { toggleZendeskWindow } from '@/app/components/base/zendesk/utils' +import { mailToSupport } from '../utils/util' +import { useAppContext } from '@/context/app-context' +import { ZENDESK_WIDGET_KEY } from '@/config' type SupportProps = { closeAccountDropdown: () => void @@ -19,6 +22,7 @@ export default function Support({ closeAccountDropdown }: SupportProps) { ` const { t } = useTranslation() const { plan } = useProviderContext() + const { userProfile, langGeniusVersionInfo } = useAppContext() const hasDedicatedChannel = plan.type !== Plan.sandbox return @@ -50,18 +54,33 @@ export default function Support({ closeAccountDropdown }: SupportProps) { )} >
- {hasDedicatedChannel && - - } + {hasDedicatedChannel && ( + + {ZENDESK_WIDGET_KEY && ZENDESK_WIDGET_KEY.trim() !== '' ? ( + + ) : ( + + +
{t('common.userProfile.emailSupport')}
+ +
+ )} +
+ )}