dify/web/app/(commonLayout)/datasets/Doc.tsx

29 lines
717 B
TypeScript
Raw Normal View History

'use client'
import type { FC } from 'react'
import { useContext } from 'use-context-selector'
import TemplateEn from './template/template.en.mdx'
import TemplateZh from './template/template.zh.mdx'
import I18n from '@/context/i18n'
2024-02-23 14:31:06 +08:00
import { LanguagesSupported } from '@/i18n/language'
type DocProps = {
apiBaseUrl: string
}
const Doc: FC<DocProps> = ({
apiBaseUrl,
}) => {
const { locale } = useContext(I18n)
return (
<article className='mx-1 px-4 sm:mx-12 pt-16 bg-white rounded-t-xl prose prose-xl'>
{
2024-02-23 14:31:06 +08:00
locale !== LanguagesSupported[1]
? <TemplateEn apiBaseUrl={apiBaseUrl} />
: <TemplateZh apiBaseUrl={apiBaseUrl} />
}
</article>
)
}
export default Doc