import { Clock } from 'lucide-react' import type { ComponentType, ReactNode } from 'react' import { LogFields } from '../components/LogFields' import type { ColumnSchema } from '../UnifiedLogs.schema' import { getRowTimestampMs } from '../UnifiedLogs.utils' import { PostgresFlowDetail } from './components/PostgresFlowDetail' import { MemoizedEdgeFunctionBlock, MemoizedGoTrueBlock, MemoizedNetworkBlock, MemoizedPostgresBlock, MemoizedPostgRESTBlock, MemoizedStorageBlock, } from './components/ServiceBlocks' import type { ServiceFlowBlockProps } from './types' import { DetailSectionHeader } from '@/components/ui/DataTable/DetailSectionHeader' type LogOverviewProps = Omit & { data: ColumnSchema rawData: unknown } function RequestOverview({ children, ...props }: LogOverviewProps & { children: ReactNode }) { const timestamp = getRowTimestampMs(props.data) return ( <> {children} ) } function PostgrestOverview(props: LogOverviewProps) { return ( ) } function AuthOverview(props: LogOverviewProps) { return ( ) } function StorageOverview(props: LogOverviewProps) { return ( ) } function EdgeFunctionOverview(props: LogOverviewProps) { return ( ) } // Renderers own the entire overview layout, independently of inspection-query support. const LOG_OVERVIEW_RENDERERS: Partial< Record> > = { postgres: PostgresFlowDetail, postgrest: PostgrestOverview, auth: AuthOverview, storage: StorageOverview, 'edge function': EdgeFunctionOverview, } export function LogOverview(props: LogOverviewProps) { const Renderer = LOG_OVERVIEW_RENDERERS[props.data.log_type] if (Renderer) return return }