Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

528 B
Raw Blame
type SearchEmptyStateInput = {
  hasActiveFilter?: boolean
  isLoading: boolean
  resultCount: number
  searchText?: string
  sourceCount: number
}

export const hasSearchText = (searchText?: string) => {
  return !!searchText?.trim()
}

export const isSearchResultEmpty = ({
  hasActiveFilter,
  isLoading,
  resultCount,
  searchText,
  sourceCount,
}: SearchEmptyStateInput) => {
  const isFiltering = hasActiveFilter ?? hasSearchText(searchText)

  return !isLoading && sourceCount > 0 && resultCount === 0 && isFiltering
}