Home / Function/ TroubleshootingFilterEmptyStateInternal() — supabase Function Reference

TroubleshootingFilterEmptyStateInternal() — supabase Function Reference

Architecture documentation for the TroubleshootingFilterEmptyStateInternal() function in Troubleshooting.ui.client.tsx from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  b0788fe8_4da6_9f3f_47a3_2c5479e2d438["TroubleshootingFilterEmptyStateInternal()"]
  d6b58f41_efbc_4023_278f_9b90e8e39130["useTroubleshootingSearchState()"]
  b0788fe8_4da6_9f3f_47a3_2c5479e2d438 -->|calls| d6b58f41_efbc_4023_278f_9b90e8e39130
  style b0788fe8_4da6_9f3f_47a3_2c5479e2d438 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/features/docs/Troubleshooting.ui.client.tsx lines 305–340

function TroubleshootingFilterEmptyStateInternal() {
  const allEntries = useRef<HTMLElement[] | undefined>(undefined)
  const { selectedProducts, selectedErrorCodes, selectedTags, searchState, reset } =
    useTroubleshootingSearchState()

  const [numberResults, setNumberResults] = useState<number | undefined>(undefined)

  useEffect(() => {
    const container = document.getElementById(TROUBLESHOOTING_CONTAINER_ID)
    if (!container) return

    const entries = Array.from(
      container.querySelectorAll(
        `[${TROUBLESHOOTING_DATA_ATTRIBUTES.QUERY_ATTRIBUTE}="${TROUBLESHOOTING_DATA_ATTRIBUTES.QUERY_VALUE_ENTRY}"]`
      )
    ) as HTMLElement[]

    allEntries.current = entries
  }, [])

  useEffect(() => {
    if (!allEntries.current) return

    const numberEntries = allEntries.current.filter((entry) => !entry.hidden).length
    setNumberResults(numberEntries)
  }, [searchState, selectedProducts, selectedErrorCodes, selectedTags])

  return numberResults === 0 ? (
    <span className="flex items-center gap-4 text-foreground-light">
      No results found.
      <Button_Shadcn_ variant="outline" className="flex items-center gap-2" onClick={reset}>
        <RotateCw size={16} /> Reset filters
      </Button_Shadcn_>
    </span>
  ) : null
}

Subdomains

Frequently Asked Questions

What does TroubleshootingFilterEmptyStateInternal() do?
TroubleshootingFilterEmptyStateInternal() is a function in the supabase codebase.
What does TroubleshootingFilterEmptyStateInternal() call?
TroubleshootingFilterEmptyStateInternal() calls 1 function(s): useTroubleshootingSearchState.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free