dify/web/app/(commonLayout)/education-apply/page.tsx
Stephen Zhou a84c2d36a3
style: format with vp fmt (#38803)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-12 15:57:46 +00:00

27 lines
930 B
TypeScript

'use client'
import { useEffect } from 'react'
import { FullScreenLoading } from '@/app/components/full-screen-loading'
import EducationApplyPage from '@/app/education-apply/education-apply-page'
import { useProviderContext } from '@/context/provider-context'
import { useRouter, useSearchParams } from '@/next/navigation'
export default function EducationApply() {
const router = useRouter()
const { enableEducationPlan, isFetchedPlanInfo, isLoadingEducationAccountInfo } =
useProviderContext()
const searchParams = useSearchParams()
const token = searchParams.get('token')
useEffect(() => {
if (!isFetchedPlanInfo) return
if (!enableEducationPlan || !token) router.replace('/')
}, [enableEducationPlan, isFetchedPlanInfo, router, token])
if (!isFetchedPlanInfo || !enableEducationPlan || !token || isLoadingEducationAccountInfo)
return <FullScreenLoading />
return <EducationApplyPage />
}