chore: support Zendesk widget (#25517)

This commit is contained in:
Nite Knite
2025-09-11 13:17:50 +08:00
committed by GitHub
parent af7f67dc9c
commit 07d067d828
8 changed files with 155 additions and 35 deletions

View File

@ -27,6 +27,8 @@ import {
useEducationStatus,
} from '@/service/use-education'
import { noop } from 'lodash-es'
import { setZendeskConversationFields } from '@/app/components/base/zendesk/utils'
import { ZENDESK_FIELD_IDS } from '@/config'
type ProviderContextState = {
modelProviders: ModelProvider[]
@ -189,6 +191,17 @@ export const ProviderContextProvider = ({
fetchPlan()
}, [])
// #region Zendesk conversation fields
useEffect(() => {
if (ZENDESK_FIELD_IDS.PLAN && plan.type) {
setZendeskConversationFields([{
id: ZENDESK_FIELD_IDS.PLAN,
value: `${plan.type}-plan`,
}])
}
}, [plan.type])
// #endregion Zendesk conversation fields
const { t } = useTranslation()
useEffect(() => {
if (localStorage.getItem('anthropic_quota_notice') === 'true')