import { BracesIcon } from 'lucide-react' import type { ComponentType, ReactNode } from 'react' import type { ColumnSchema } from '../UnifiedLogs.schema' import { GenericLogOverview, LogAttributes } from './components/GenericLogOverview' import { PostgresFlowDetail } from './components/PostgresFlowDetail' import { MemoizedEdgeFunctionBlock, MemoizedGoTrueBlock, MemoizedNetworkBlock, MemoizedPostgresBlock, MemoizedPostgRESTBlock, MemoizedStorageBlock, MemoizedSupavisorBlock, } from './components/ServiceBlocks' import type { AddAttributeFilter, ServiceFlowBlockProps } from './types' import { CollapsibleDetailSection } from '@/components/ui/DataTable/CollapsibleDetailSection' type LogOverviewProps = Omit & { data: ColumnSchema } function RequestOverview({ children, ...props }: LogOverviewProps & { children: ReactNode }) { return ( <> {children} ) } function SupavisorOverview(props: LogOverviewProps) { return } 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, supavisor: SupavisorOverview, } export function LogOverview({ header, attributes, onAddAttributeFilter, ...props }: LogOverviewProps & { header?: ReactNode attributes?: ColumnSchema['metadata'] onAddAttributeFilter?: AddAttributeFilter }) { const Renderer = LOG_OVERVIEW_RENDERERS[props.data.log_type] return ( <> {header} {Renderer ? ( <> {attributes && Object.keys(attributes).length > 0 && ( )} ) : ( )} ) }