Home / Function/ Recommendations() — supabase Function Reference

Recommendations() — supabase Function Reference

Architecture documentation for the Recommendations() function in NotFound.client.tsx from the supabase codebase.

Entity Profile

Relationship Graph

Source Code

apps/docs/features/recommendations/NotFound.client.tsx lines 23–53

function Recommendations() {
  const pathname = usePathname()

  const { searchState: state, handleDocsSearch: handleSearch } = useDocsSearch()

  const loading = state.status === 'initial' || state.status === 'loading'
  const recommendations =
    state.status === 'partialResults' || state.status === 'fullResults' ? state.results : []

  useEffect(() => {
    if (!pathname) return

    const query = decodeURIComponent(pathname.replace(/^\/(?:guides|reference)\//, '')).replace(
      /[_\/-]/g,
      ' '
    )

    handleSearch(query)
  }, [handleSearch, pathname])

  return (
    <section aria-labelledby="empty-page-recommendations" className="min-h-96 mt-20">
      <h2 id="empty-page-recommendations">Are you looking for...?</h2>
      {loading && <LoadingState />}
      {!loading && recommendations.length === 0 && <NoResults />}
      {!loading && recommendations.length > 0 && (
        <RecommendationsList recommendations={recommendations} />
      )}
    </section>
  )
}

Subdomains

Analyze Your Own Codebase

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

Try Supermodel Free