mirror of
https://github.com/supabase/supabase.git
synced 2026-05-07 17:30:25 -04:00
4a0bb36ca8
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
36 lines
1003 B
TypeScript
36 lines
1003 B
TypeScript
import { useParams } from 'common'
|
|
import { useEffect } from 'react'
|
|
|
|
import { PresetHookResult } from '../Reports/Reports.utils'
|
|
import { QueryPerformanceInfiniteHook } from './useQueryPerformanceQuery'
|
|
import { WithStatements } from './WithStatements/WithStatements'
|
|
import { useDatabaseSelectorStateSnapshot } from '@/state/database-selector'
|
|
|
|
interface QueryPerformanceProps {
|
|
queryHitRate: PresetHookResult
|
|
queryPerformanceQuery: QueryPerformanceInfiniteHook
|
|
queryMetrics: PresetHookResult
|
|
}
|
|
|
|
export const QueryPerformance = ({
|
|
queryHitRate,
|
|
queryPerformanceQuery,
|
|
queryMetrics,
|
|
}: QueryPerformanceProps) => {
|
|
const { ref } = useParams()
|
|
const state = useDatabaseSelectorStateSnapshot()
|
|
|
|
useEffect(() => {
|
|
state.setSelectedDatabaseId(ref)
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
}, [ref])
|
|
|
|
return (
|
|
<WithStatements
|
|
queryHitRate={queryHitRate}
|
|
queryPerformanceQuery={queryPerformanceQuery}
|
|
queryMetrics={queryMetrics}
|
|
/>
|
|
)
|
|
}
|