mirror of
https://github.com/langgenius/dify.git
synced 2026-06-23 12:31:13 +08:00
Co-authored-by: zhangx1n <zhangxin@dify.ai> Co-authored-by: yyh <yuanyouhuilyz@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
42 lines
1005 B
TypeScript
42 lines
1005 B
TypeScript
'use client'
|
|
|
|
import type { ReactNode } from 'react'
|
|
import { ScopeProvider } from 'jotai-scope'
|
|
import { useQueryState } from 'nuqs'
|
|
import {
|
|
deploymentsListEnvironmentIdAtom,
|
|
deploymentsListKeywordsAtom,
|
|
envFilterQueryState,
|
|
keywordsQueryState,
|
|
} from './state'
|
|
import { DeploymentsListShell } from './ui/shell'
|
|
|
|
function DeploymentsListStateBoundary({ children }: {
|
|
children: ReactNode
|
|
}) {
|
|
const [envFilter] = useQueryState('env', envFilterQueryState)
|
|
const [keywords] = useQueryState('keywords', keywordsQueryState)
|
|
const stateKey = `${envFilter ?? 'all'}:${keywords}`
|
|
|
|
return (
|
|
<ScopeProvider
|
|
key={stateKey}
|
|
atoms={[
|
|
[deploymentsListEnvironmentIdAtom, envFilter],
|
|
[deploymentsListKeywordsAtom, keywords],
|
|
]}
|
|
name="DeploymentsList"
|
|
>
|
|
{children}
|
|
</ScopeProvider>
|
|
)
|
|
}
|
|
|
|
export function DeploymentsList() {
|
|
return (
|
|
<DeploymentsListStateBoundary>
|
|
<DeploymentsListShell />
|
|
</DeploymentsListStateBoundary>
|
|
)
|
|
}
|