mirror of
https://github.com/langgenius/dify.git
synced 2026-09-07 18:36:02 +08:00
29 lines
733 B
TypeScript
29 lines
733 B
TypeScript
import { debounce, parseAsString, parseAsStringLiteral } from 'nuqs'
|
|
|
|
export const DOCUMENT_FILTERS = [
|
|
'all',
|
|
'ready',
|
|
'queued',
|
|
'processing',
|
|
'failed',
|
|
'disabled',
|
|
] as const
|
|
|
|
export type DocumentFilter = (typeof DOCUMENT_FILTERS)[number]
|
|
|
|
export const documentFilterParser = parseAsStringLiteral(DOCUMENT_FILTERS)
|
|
.withDefault('all')
|
|
.withOptions({ history: 'push' })
|
|
|
|
export const documentSearchParser = parseAsString.withDefault('').withOptions({
|
|
limitUrlUpdates: debounce(300),
|
|
})
|
|
|
|
export const documentUploadParser = parseAsStringLiteral(['1'] as const).withOptions({
|
|
history: 'replace',
|
|
})
|
|
|
|
export const documentMetadataParser = parseAsStringLiteral(['1'] as const).withOptions({
|
|
history: 'replace',
|
|
})
|