import { MousePointerClick, X } from 'lucide-react' import { Button, CodeBlock, TabsContent_Shadcn_, TabsList_Shadcn_, TabsTrigger_Shadcn_, Tabs_Shadcn_, cn, } from 'ui' import AuthSelectionRenderer from './LogSelectionRenderers/AuthSelectionRenderer' import DatabaseApiSelectionRender from './LogSelectionRenderers/DatabaseApiSelectionRender' import DatabasePostgresSelectionRender from './LogSelectionRenderers/DatabasePostgresSelectionRender' import DefaultPreviewSelectionRenderer from './LogSelectionRenderers/DefaultPreviewSelectionRenderer' import FunctionInvocationSelectionRender from './LogSelectionRenderers/FunctionInvocationSelectionRender' import FunctionLogsSelectionRender from './LogSelectionRenderers/FunctionLogsSelectionRender' import type { LogData, QueryType } from './Logs.types' import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader' import { WarehouseSelectionRenderer } from './LogSelectionRenderers/WarehouseSelectionRenderer' export interface LogSelectionProps { log?: LogData onClose: () => void queryType?: QueryType projectRef: string collectionName?: string isLoading: boolean error?: string | object } const LogSelection = ({ log, onClose, queryType, isLoading, error }: LogSelectionProps) => { const LogDetails = () => { if (error) return if (!log) return // if (!log.metadata) return switch (queryType) { case 'warehouse': return case 'api': return case 'database': return case 'fn_edge': return case 'functions': return case 'auth': return default: return } } return (
Details Raw
{isLoading ? (
) : ( <> {JSON.stringify(log, null, 2)} )}
) } export default LogSelection function LogDetailEmptyState({ title = 'Select an Event', message = 'Select an Event to view the complete JSON payload', }: { title?: string message?: string }) { return (

{title}

{message}

) } function LogErrorState({ error }: { error?: string | object }) { return
{JSON.stringify(error, null, 2)}
}