diff --git a/src/app/(main)/discover/(detail)/provider/[slug]/features/ProviderConfig.tsx b/src/app/(main)/discover/(detail)/provider/[slug]/features/ProviderConfig.tsx index 21df86c01343..4d71eab7b63a 100644 --- a/src/app/(main)/discover/(detail)/provider/[slug]/features/ProviderConfig.tsx +++ b/src/app/(main)/discover/(detail)/provider/[slug]/features/ProviderConfig.tsx @@ -1,16 +1,17 @@ 'use client'; import { Icon } from '@lobehub/ui'; -import { Button, Dropdown } from 'antd'; +import { Button, ButtonProps, Dropdown } from 'antd'; import { createStyles } from 'antd-style'; import { ChevronDownIcon, SquareArrowOutUpRight } from 'lucide-react'; import Link from 'next/link'; -import { memo } from 'react'; +import React, { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { FlexboxProps } from 'react-layout-kit'; import { useOpenSettings } from '@/hooks/useInterceptingRoutes'; import { SettingsTabs } from '@/store/global/initialState'; +import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig'; import { DiscoverProviderItem } from '@/types/discover'; const useStyles = createStyles(({ css }) => ({ @@ -30,6 +31,7 @@ const ProviderConfig = memo(({ data }) => { const { styles } = useStyles(); const { t } = useTranslation('discover'); const openSettings = useOpenSettings(SettingsTabs.LLM); + const { showLLM } = useServerConfigStore(featureFlagsSelectors); const icon = ; @@ -56,13 +58,23 @@ const ProviderConfig = memo(({ data }) => { if (!items || items?.length === 0) return ( - ); return ( { + const [leftButton, rightButton] = buttons as React.ReactElement[]; + return [{ ...leftButton, props: { ...leftButton.props, disabled: !showLLM } }, rightButton]; + }} className={styles.button} icon={} menu={{ items }}