Home / Function/ useTroubleshootingSearchState() — supabase Function Reference

useTroubleshootingSearchState() — supabase Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  d6b58f41_efbc_4023_278f_9b90e8e39130["useTroubleshootingSearchState()"]
  b195ca97_6df5_8f5d_05ae_8d934c018ddd["TroubleshootingFilterMobileCollapsed()"]
  b195ca97_6df5_8f5d_05ae_8d934c018ddd -->|calls| d6b58f41_efbc_4023_278f_9b90e8e39130
  799d8a70_c062_29ce_481e_96e0e7857118["TroubleshootingFilterInternal()"]
  799d8a70_c062_29ce_481e_96e0e7857118 -->|calls| d6b58f41_efbc_4023_278f_9b90e8e39130
  b0788fe8_4da6_9f3f_47a3_2c5479e2d438["TroubleshootingFilterEmptyStateInternal()"]
  b0788fe8_4da6_9f3f_47a3_2c5479e2d438 -->|calls| d6b58f41_efbc_4023_278f_9b90e8e39130
  71ab7703_5840_6100_57f2_d212311b9522["TroubleshootingListControllerInternal()"]
  71ab7703_5840_6100_57f2_d212311b9522 -->|calls| d6b58f41_efbc_4023_278f_9b90e8e39130
  style d6b58f41_efbc_4023_278f_9b90e8e39130 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/features/docs/Troubleshooting.ui.client.tsx lines 25–79

function useTroubleshootingSearchState() {
  const [_state, _setState] = useQueryStates(troubleshootingSearchParams)

  const setSelectedProducts = useCallback(
    (products: string[]) => {
      _setState({
        products: products.length === 0 ? [] : products,
      })
    },
    [_setState]
  )
  const setSelectedErrorCodes = useCallback(
    (errorCodes: string[]) => {
      _setState({
        errorCodes: errorCodes.length === 0 ? [] : errorCodes,
      })
    },
    [_setState]
  )
  const setSelectedTags = useCallback(
    (tags: string[]) => {
      _setState({
        tags: tags.length === 0 ? [] : tags,
      })
    },
    [_setState]
  )
  const setSearchState = useCallback(
    (search: string) => {
      _setState({
        search: search.length === 0 ? null : search,
      })
    },
    [_setState]
  )

  const reset = useCallback(() => {
    setSearchState('')
    setSelectedTags([])
    setSelectedProducts([])
    setSelectedErrorCodes([])
  }, [setSearchState, setSelectedTags, setSelectedProducts, setSelectedErrorCodes])

  return {
    selectedProducts: _state.products,
    selectedErrorCodes: _state.errorCodes,
    selectedTags: _state.tags,
    searchState: _state.search,
    setSelectedProducts,
    setSelectedErrorCodes,
    setSelectedTags,
    setSearchState,
    reset,
  }
}

Subdomains

Frequently Asked Questions

What does useTroubleshootingSearchState() do?
useTroubleshootingSearchState() is a function in the supabase codebase.
What calls useTroubleshootingSearchState()?
useTroubleshootingSearchState() is called by 4 function(s): TroubleshootingFilterEmptyStateInternal, TroubleshootingFilterInternal, TroubleshootingFilterMobileCollapsed, TroubleshootingListControllerInternal.

Analyze Your Own Codebase

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

Try Supermodel Free