dify/web/app/education-apply/page.tsx

25 lines
680 B
TypeScript
Raw Normal View History

2025-03-14 15:13:56 +08:00
'use client'
import {
useEffect,
useMemo,
} from 'react'
import { useRouter } from 'next/navigation'
2025-03-11 15:49:41 +08:00
import EducationApplyAge from './components/education-apply-page'
2025-03-15 14:32:50 +08:00
import { useProviderContext } from '@/context/provider-context'
2025-03-11 15:49:41 +08:00
export default function EducationApply() {
2025-03-14 15:13:56 +08:00
const router = useRouter()
2025-03-15 14:32:50 +08:00
const { enableEducationPlan, isEducationAccount } = useProviderContext()
2025-03-14 15:13:56 +08:00
const hiddenEducationApply = useMemo(() => {
2025-03-15 14:32:50 +08:00
return enableEducationPlan && isEducationAccount
}, [enableEducationPlan, isEducationAccount])
2025-03-14 15:13:56 +08:00
useEffect(() => {
if (hiddenEducationApply)
router.replace('/')
}, [hiddenEducationApply, router])
2025-03-12 10:05:10 +08:00
return <EducationApplyAge />
2025-03-11 15:49:41 +08:00
}