mirror of
https://github.com/langgenius/dify.git
synced 2026-05-13 08:57:28 +08:00
Follow-up to SSR prefetch migration (2833965). Eliminates the Zustand
middleman that was syncing TanStack Query data into a separate store.
- Remove useGlobalPublicStore Zustand store entirely
- Create hooks/use-global-public.ts with useSystemFeatures,
useSystemFeaturesQuery, useIsSystemFeaturesPending, useSetupStatusQuery
- Migrate all 93 consumers to import from @/hooks/use-global-public
- Simplify global-public-context.tsx to a thin provider component
- Update 18 test files to mock the new hook interface
- Fix SetupStatusResponse.setup_at type from Date to string (JSON)
- Fix setup-status.spec.ts mock target to match consoleClient
BREAKING CHANGE: useGlobalPublicStore is removed. Use useSystemFeatures()
from @/hooks/use-global-public instead.
30 lines
932 B
TypeScript
30 lines
932 B
TypeScript
'use client'
|
|
import * as React from 'react'
|
|
import { useSystemFeatures } from '@/hooks/use-global-public'
|
|
import { cn } from '@/utils/classnames'
|
|
import Header from '../signin/_header'
|
|
import ActivateForm from './activateForm'
|
|
|
|
const Activate = () => {
|
|
const systemFeatures = useSystemFeatures()
|
|
return (
|
|
<div className={cn('flex min-h-screen w-full justify-center bg-background-default-burn p-6')}>
|
|
<div className={cn('flex w-full shrink-0 flex-col rounded-2xl border border-effects-highlight bg-background-default-subtle')}>
|
|
<Header />
|
|
<ActivateForm />
|
|
{!systemFeatures.branding.enabled && (
|
|
<div className="px-8 py-6 text-sm font-normal text-text-tertiary">
|
|
©
|
|
{' '}
|
|
{new Date().getFullYear()}
|
|
{' '}
|
|
LangGenius, Inc. All rights reserved.
|
|
</div>
|
|
)}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default Activate
|