mirror of
https://github.com/langgenius/dify.git
synced 2026-09-04 16:07:08 +08:00
27 lines
638 B
TypeScript
27 lines
638 B
TypeScript
import type { SourceDisplayStatus } from './source-models'
|
|
import { debounce, parseAsString, parseAsStringLiteral } from 'nuqs'
|
|
|
|
export type SourceFilter = SourceDisplayStatus | 'all'
|
|
|
|
export const sourceFilterParser = parseAsStringLiteral([
|
|
'all',
|
|
'active',
|
|
'initializing',
|
|
'syncing',
|
|
'disabled',
|
|
'error',
|
|
] as const)
|
|
.withDefault('all')
|
|
.withOptions({ history: 'push' })
|
|
|
|
export const sourceSearchParser = parseAsString.withDefault('').withOptions({
|
|
limitUrlUpdates: debounce(300),
|
|
})
|
|
|
|
export const sourceSortParser = parseAsStringLiteral([
|
|
'name-asc',
|
|
'name-desc',
|
|
] as const).withOptions({
|
|
history: 'push',
|
|
})
|