mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
29 lines
924 B
TypeScript
29 lines
924 B
TypeScript
'use client'
|
|
import type { FC } from 'react'
|
|
import { useRouter } from 'next/navigation'
|
|
import { useTranslation } from 'react-i18next'
|
|
import React, { useEffect } from 'react'
|
|
import ToolProviderList from '@/app/components/tools/provider-list'
|
|
import { useAppContext } from '@/context/app-context'
|
|
|
|
const Layout: FC = () => {
|
|
const { t } = useTranslation()
|
|
const router = useRouter()
|
|
const { isCurrentWorkspaceDatasetOperator } = useAppContext()
|
|
|
|
useEffect(() => {
|
|
if (typeof window !== 'undefined')
|
|
document.title = `${t('tools.title')} - Dify`
|
|
if (isCurrentWorkspaceDatasetOperator)
|
|
return router.replace('/datasets')
|
|
}, [isCurrentWorkspaceDatasetOperator, router, t])
|
|
|
|
useEffect(() => {
|
|
if (isCurrentWorkspaceDatasetOperator)
|
|
return router.replace('/datasets')
|
|
}, [isCurrentWorkspaceDatasetOperator, router])
|
|
|
|
return <ToolProviderList />
|
|
}
|
|
export default React.memo(Layout)
|