import { useTranslation } from 'react-i18next' import { DropdownMenuGroup, DropdownMenuItem, DropdownMenuLinkItem, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger } from '@/app/components/base/ui/dropdown-menu' import { toggleZendeskWindow } from '@/app/components/base/zendesk/utils' import { Plan } from '@/app/components/billing/type' import { SUPPORT_EMAIL_ADDRESS, ZENDESK_WIDGET_KEY } from '@/config' import { useAppContext } from '@/context/app-context' import { useProviderContext } from '@/context/provider-context' import { mailToSupport } from '../utils/util' import { ExternalLinkIndicator, MenuItemContent } from './menu-item-content' type SupportProps = { closeAccountDropdown: () => void } // Submenu-only: this component must be rendered within an existing DropdownMenu root. export default function Support({ closeAccountDropdown }: SupportProps) { const { t } = useTranslation() const { plan } = useProviderContext() const { userProfile, langGeniusVersionInfo } = useAppContext() const hasDedicatedChannel = plan.type !== Plan.sandbox || Boolean(SUPPORT_EMAIL_ADDRESS.trim()) const hasZendeskWidget = Boolean(ZENDESK_WIDGET_KEY.trim()) return ( {hasDedicatedChannel && hasZendeskWidget && ( { toggleZendeskWindow(true) closeAccountDropdown() }} > )} {hasDedicatedChannel && !hasZendeskWidget && ( } /> )} } /> } /> ) }