mirror of
https://github.com/langgenius/dify.git
synced 2026-08-28 20:03:22 +08:00
chore: hide disable try tab when not support (#31759)
This commit is contained in:
parent
f90fa2b186
commit
4346f61b0c
@ -2,6 +2,7 @@
|
|||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
import { IS_CLOUD_EDITION } from '@/config'
|
||||||
import TabHeader from '../../base/tab-header'
|
import TabHeader from '../../base/tab-header'
|
||||||
|
|
||||||
export enum TypeEnum {
|
export enum TypeEnum {
|
||||||
@ -21,10 +22,13 @@ const Tab: FC<Props> = ({
|
|||||||
disableTry,
|
disableTry,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const tabs = [
|
|
||||||
{ id: TypeEnum.TRY, name: t('tryApp.tabHeader.try', { ns: 'explore' }), disabled: disableTry },
|
const tabs = React.useMemo(() => {
|
||||||
|
return [
|
||||||
|
IS_CLOUD_EDITION ? { id: TypeEnum.TRY, name: t('tryApp.tabHeader.try', { ns: 'explore' }), disabled: disableTry } : null,
|
||||||
{ id: TypeEnum.DETAIL, name: t('tryApp.tabHeader.detail', { ns: 'explore' }) },
|
{ id: TypeEnum.DETAIL, name: t('tryApp.tabHeader.detail', { ns: 'explore' }) },
|
||||||
]
|
].filter(item => item !== null) as { id: TypeEnum, name: string }[]
|
||||||
|
}, [t, disableTry])
|
||||||
return (
|
return (
|
||||||
<TabHeader
|
<TabHeader
|
||||||
items={tabs}
|
items={tabs}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user