mirror of
https://github.com/langgenius/dify.git
synced 2026-09-07 18:36:02 +08:00
24 lines
638 B
TypeScript
24 lines
638 B
TypeScript
import { atomWithLazy } from 'jotai/utils'
|
|
import { createQueryAtoms } from 'nuqs-jotai'
|
|
import { documentFilterParser, documentSearchParser } from '../query-state'
|
|
|
|
export const documentsKnowledgeSpaceIdAtom = atomWithLazy<string>(() => {
|
|
throw new Error('Missing documents knowledge space id')
|
|
})
|
|
|
|
export const documentsQuery = createQueryAtoms(
|
|
{
|
|
filter: documentFilterParser,
|
|
search: documentSearchParser,
|
|
},
|
|
{
|
|
debugLabel: 'documents.query',
|
|
urlKeys: {
|
|
filter: 'status',
|
|
search: 'query',
|
|
},
|
|
},
|
|
)
|
|
|
|
export const { filter: documentFilterAtom, search: documentSearchAtom } = documentsQuery.atoms
|